-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathcontinuous-integration-reduced.yml
More file actions
116 lines (96 loc) · 3.73 KB
/
continuous-integration-reduced.yml
File metadata and controls
116 lines (96 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Copied and modified from continuous-integration.yml
name: CI w/ reduced CRT Kotlin
on:
pull_request:
workflow_dispatch:
permissions:
id-token: write
contents: read
concurrency:
group: ci-reduced-pr-${{ github.ref }}
cancel-in-progress: true
env:
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false"
jobs:
jvm:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
java-version:
- 8
- 11
- 17
- 21
steps:
- name: Set start timestamp
id: start
run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT"
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
aws-region: us-west-2
- name: Setup kat
uses: aws/aws-kotlin-repo-tools/.github/actions/setup-kat@main
- name: Checkout smithy-kotlin
uses: actions/checkout@v4
- name: Configure Gradle (Smithy Kotlin)
uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
- name: Checkout aws-crt-kotlin
uses: aws/aws-kotlin-repo-tools/.github/actions/checkout-head@main
with:
path: 'aws-crt-kotlin' # '.' would make this a sibling, and include build. Overriding reduced JAR dependency.
repository: 'aws/aws-crt-kotlin'
submodules: 'true'
- name: Configure Gradle (CRT Kotlin)
uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
with:
working-directory: './aws-crt-kotlin'
- name: Configure JDK
uses: actions/setup-java@v3
with:
distribution: 'corretto'
java-version: 17
cache: 'gradle'
# TODO: Replace with kat command (SDK-KT-1089)
- name: Enable JAR reduction & disable Kotlin Native
uses: aws/aws-kotlin-repo-tools/.github/actions/utils/add-to-local-properties@main
with:
working-directory: '~/.sdkdev'
addition: 'aws.kotlin.native = false'
- name: Publish reduced CRT Kotlin to Maven Local
working-directory: './aws-crt-kotlin'
run: |
./gradlew publishToMavenLocal # publish full size and reduced JARs
./gradlew replaceMavenLocalFullSizeJars # reduce JARs become the default
# The checked out CRT Kotlin version might be a SNAPSHOT version e.g. in cross repo features (and include builds are off).
- name: Depend on checked out CRT Kotlin version
run: |
cd ./aws-crt-kotlin
version=$(kat get-property sdkVersion)
echo "Found CRT version: $version"
cd ..
kat bump-version --file gradle/libs.versions.toml --property crt-kotlin-version --version $version
- name: Build and Test Smithy Kotlin on JVM (with dependency on reduced CRT Kotlin)
run: |
./gradlew -Ptest.java.version=${{ matrix.java-version }} jvmTest --stacktrace
- name: Calculate duration
id: end
if: always()
run: |
printf -v now '%(%s)T'
duration=$(( now - ${{ steps.start.outputs.timestamp }} ))
echo "duration=$duration" >> "$GITHUB_OUTPUT"
- name: Emit metrics
if: always()
uses: aws/aws-kotlin-repo-tools/.github/actions/emit-metrics@main
with:
namespace: CI Metrics
dimensions: |
Product=smithy-kotlin
JobName=${{ github.job }}(${{ matrix.java-version }})-reduced
Branch=${{ github.base_ref || github.ref_name }}
metrics: |
WorkflowSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count
WorkflowDuration:${{ steps.end.outputs.duration }}:Seconds