-
Notifications
You must be signed in to change notification settings - Fork 50
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
Merged
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
fdbe639
chore: add release checks
aajtodd 550950f
revert snapshot test
aajtodd fdb19bb
add concurrency protections
aajtodd a7fad65
tickle ci
aajtodd 6dd7452
fixes
aajtodd 483066d
tickle ci
aajtodd 67e022b
use jdk17 for codegen
aajtodd 9318825
update release checks
aajtodd 9425303
wip composite action
aajtodd 2169ef5
separate out build setup into a reusable action
aajtodd 85d35f9
try again
aajtodd 11d93a1
sigh
aajtodd a4f03f9
missing parens
aajtodd c3bb626
fanout
aajtodd 7b72ed2
round 2
aajtodd 940dbe1
round 3
aajtodd 258fd5a
try harder
aajtodd a6582fa
fix props
aajtodd 224299e
explicitly set jvmTarget compat rather than rely on default
aajtodd 365e87c
bump jvm version for codegen diff preview
aajtodd 2d1c469
fix workflow
aajtodd 9872471
capture test outputs
aajtodd 71307f3
use tagged repo tools and update to windows-latest image to match smi…
aajtodd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: '0.2.3' | ||
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-latest ] | ||
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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).