-
Notifications
You must be signed in to change notification settings - Fork 61
170 lines (165 loc) · 5.85 KB
/
Copy pathcontinuous-integration.yml
File metadata and controls
170 lines (165 loc) · 5.85 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: CI
on:
pull_request:
merge_group:
types: [checks_requested]
workflow_dispatch:
permissions:
id-token: write
contents: read
# 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:
RUN: ${{ github.run_id }}-${{ github.run_number }}
GRADLE_OPTS: "-Dorg.gradle.daemon=false -Dkotlin.incremental=false"
jobs:
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: Set start timestamp
id: start
run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT"
- name: Checkout sources
uses: actions/checkout@v4
with:
path: 'aws-sdk-kotlin'
- name: Setup Build
uses: ./aws-sdk-kotlin/.github/actions/setup-build
- name: Configure Gradle
uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
with:
working-directory: ./aws-sdk-kotlin
- 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: Test
working-directory: ./aws-sdk-kotlin
shell: bash
run: |
pwd
ls -lsa
./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() # run this step even if previous steps failed or the job is canceled
uses: aws/aws-kotlin-repo-tools/.github/actions/emit-metrics@main
with:
namespace: CI Metrics
dimensions: |
Product=aws-sdk-kotlin
JobName=${{ github.job }}(${{ matrix.java-version }})
Branch=${{ github.base_ref || github.ref_name }}
metrics: |
WorkflowSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count
WorkflowDuration:${{ steps.end.outputs.duration }}:Seconds
- name: Save Test Reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: '**/build/reports'
all-platforms:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
steps:
- name: Set start timestamp
id: start
shell: bash
run: echo "timestamp=$(date +%s)" >> "$GITHUB_OUTPUT"
- name: Checkout sources
uses: actions/checkout@v4
with:
path: 'aws-sdk-kotlin'
- name: Setup Build
uses: ./aws-sdk-kotlin/.github/actions/setup-build
- 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: Configure Gradle - smithy-kotlin
uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
with:
working-directory: ./smithy-kotlin
- name: Disable native builds # FIXME remove this step once K/N is merged
shell: bash
run: |
echo "Appending aws.kotlin.native=false to smithy-kotlin/gradle.properties..."
echo -e "\n\naws.kotlin.native=false" >> ./smithy-kotlin/gradle.properties
echo "Appending aws.kotlin.native=false to aws-sdk-kotlin/gradle.properties..."
echo -e "\n\naws.kotlin.native=false" >> ./aws-sdk-kotlin/gradle.properties
- name: Build smithy-kotlin
working-directory: ./smithy-kotlin
shell: bash
run: |
# protocol tests require everything is published
pwd
./gradlew assemble
./gradlew publishToMavenLocal
- name: Configure Gradle aws-sdk-kotlin
uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
with:
working-directory: ./aws-sdk-kotlin
- name: Test
working-directory: ./aws-sdk-kotlin
shell: bash
run: |
pwd
./gradlew :build-support:test
./gradlew publishToMavenLocal
./gradlew apiCheck
./gradlew test jvmTest
./gradlew testAllProtocols
- name: Calculate duration
id: end
if: always()
shell: bash
run: |
now=$(date +%s)
duration=$(( now - ${{ steps.start.outputs.timestamp }} ))
echo "duration=$duration" >> "$GITHUB_OUTPUT"
- name: Emit metrics
if: always() # run this step even if previous steps failed or the job is canceled
uses: aws/aws-kotlin-repo-tools/.github/actions/emit-metrics@main
with:
namespace: CI Metrics
dimensions: |
Product=aws-sdk-kotlin
JobName=${{ github.job }}(${{ matrix.os }})
Branch=${{ github.base_ref || github.ref_name }}
metrics: |
WorkflowSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count
WorkflowDuration:${{ steps.end.outputs.duration }}:Seconds
- name: Save Test Reports
if: failure()
uses: actions/upload-artifact@v4
with:
name: test-reports
path: '**/build/reports'