-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: add release checks #1069
Changes from 22 commits
fdbe639
550950f
fdb19bb
a7fad65
6dd7452
483066d
67e022b
9318825
9425303
2169ef5
85d35f9
11d93a1
a4f03f9
c3bb626
7b72ed2
940dbe1
258fd5a
a6582fa
224299e
365e87c
2d1c469
9872471
71307f3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Setup Build | ||
description: > | ||
Checkout repositories and build dependencies | ||
|
||
runs: | ||
using: composite | ||
steps: | ||
- name: Checkout tools | ||
uses: actions/checkout@v4 | ||
with: | ||
path: 'aws-kotlin-repo-tools' | ||
repository: 'awslabs/aws-kotlin-repo-tools' | ||
ref: 'gh-action' | ||
sparse-checkout: | | ||
.github | ||
- name: Checkout smithy-kotlin | ||
uses: ./aws-kotlin-repo-tools/.github/actions/checkout-head | ||
with: | ||
# checkout smithy-kotlin as a sibling which will automatically make it an included build | ||
path: 'smithy-kotlin' | ||
repository: 'awslabs/smithy-kotlin' | ||
- name: Configure JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: 17 | ||
cache: 'gradle' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,79 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
pull_request: | ||
branches: | ||
- main | ||
- 'feat-*' | ||
workflow_dispatch: | ||
|
||
# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed | ||
concurrency: | ||
group: ci-pr-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
BUILDER_VERSION: v0.8.22 | ||
BUILDER_SOURCE: releases | ||
# host owned by CRT team to host aws-crt-builder releases. Contact their on-call with any issues | ||
BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net | ||
PACKAGE_NAME: aws-sdk-kotlin | ||
RUN: ${{ github.run_id }}-${{ github.run_number }} | ||
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false" | ||
|
||
jobs: | ||
linux-compat: | ||
jvm: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
# we build with a specific JDK version but source/target compatibility should ensure the jar is usable by | ||
# the target versions we want to support | ||
java-version: | ||
- 8 | ||
- 11 | ||
- 17 | ||
- 21 | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build and Test ${{ env.PACKAGE_NAME }} | ||
run: | | ||
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" | ||
chmod a+x builder.pyz | ||
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties | ||
./builder.pyz build -p ${{ env.PACKAGE_NAME }} | ||
|
||
macos-compat: | ||
runs-on: macos-latest | ||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: | | ||
~/.gradle/caches | ||
~/.gradle/wrapper | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }} | ||
restore-keys: | | ||
${{ runner.os }}-gradle- | ||
- name: Build and Test ${{ env.PACKAGE_NAME }} | ||
path: 'aws-sdk-kotlin' | ||
- name: Setup Build | ||
uses: ./aws-sdk-kotlin/.github/actions/setup-build | ||
- name: Test | ||
working-directory: ./aws-sdk-kotlin | ||
shell: bash | ||
run: | | ||
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" | ||
chmod a+x builder.pyz | ||
echo "kotlinWarningsAsErrors=true" >> $GITHUB_WORKSPACE/local.properties | ||
./builder.pyz build -p ${{ env.PACKAGE_NAME }} | ||
pwd | ||
ls -lsa | ||
./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace | ||
|
||
windows-compat: | ||
runs-on: windows-2019 | ||
all-platforms: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ ubuntu-latest, macos-latest, windows-2019 ] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Question: I notice that the smithy-kotlin PR uses There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't recall why this one is set to 2019, I can try windows-latest though and see what shakes out. |
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v2 | ||
- uses: actions/setup-java@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
distribution: 'temurin' | ||
java-version: '11' | ||
cache: 'gradle' | ||
- name: Modify Gradle Daemon JVM Args | ||
# windows job runs out of memory with the defaults normally used | ||
path: 'aws-sdk-kotlin' | ||
- name: Setup Build | ||
uses: ./aws-sdk-kotlin/.github/actions/setup-build | ||
- name: Build smithy-kotlin | ||
working-directory: ./smithy-kotlin | ||
shell: bash | ||
run: | | ||
systeminfo | ||
sed -i 's/org\.gradle\.jvmargs=.*$/org.gradle.jvmargs=-Xmx2g/' gradle.properties | ||
echo "org.gradle.parallel=false" >> gradle.properties | ||
cat gradle.properties | ||
- name: Build and Test ${{ env.PACKAGE_NAME }} | ||
# protocol tests require everything is published | ||
pwd | ||
./gradlew --parallel assemble | ||
./gradlew publishToMavenLocal | ||
- name: Test | ||
working-directory: ./aws-sdk-kotlin | ||
shell: bash | ||
run: | | ||
python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz?run=${{ env.RUN }}', 'builder.pyz')" | ||
java -version | ||
python3 builder.pyz build -p ${{ env.PACKAGE_NAME }} | ||
pwd | ||
./gradlew publishToMavenLocal | ||
./gradlew apiCheck | ||
./gradlew test allTests | ||
./gradlew testAllProtocols | ||
- name: Save Test Reports | ||
if: failure() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: test-reports | ||
path: '**/build/reports' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Release Checks | ||
|
||
on: | ||
pull_request: | ||
types: [ opened, synchronize, reopened ] | ||
branches: [ main ] | ||
|
||
# Allow one instance of this workflow per pull request, and cancel older runs when new changes are pushed | ||
concurrency: | ||
group: ci-release-check-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
release-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Configure JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: 17 | ||
cache: 'gradle' | ||
- name: Check for snapshot versions | ||
run: | | ||
# We aren't releasable if we (1) directly depend on a snapshot version of a dependency OR (2) can't build the project without unreleased changes | ||
if grep -q -i snapshot ./gradle/libs.versions.toml; then | ||
echo "::error ::found snapshot version in libs.versions.toml" | ||
exit 1 | ||
fi | ||
- name: Build check | ||
run: | | ||
# Our CI is implemented as a "live at HEAD" model where we build against the latest of all our 1P deps (either | ||
# main branch or matching branch name). Double check that without this "live at HEAD" mode we still build | ||
# successfully (which is how it is built during release). | ||
# This should help prevent the cases where we forgot to bump smithy-kotlin versions and don't catch it | ||
# because CI is masking it | ||
./gradlew test jvmTest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Do we also need to checkout aws-crt-kotlin?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ideally this would be handled by improving this tooling. Right now we don't update
aws-crt-kotlin
often enough or with large enough changes that it's worth considering at the moment. I'm thinking we revisit this when it's a problem and we need it (likely as we pursue other KMP targets).