Skip to content

Commit ad23744

Browse files
authored
misc: refactor artifact size metrics & service check batch (#1701)
1 parent 0d76c97 commit ad23744

File tree

6 files changed

+124
-253
lines changed

6 files changed

+124
-253
lines changed

.github/workflows/codebuild-ci.yml

Lines changed: 0 additions & 244 deletions
This file was deleted.

.github/workflows/e2e-tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: E2E tests
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
e2e-tests:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Configure credentials
12+
uses: aws-actions/configure-aws-credentials@v4
13+
with:
14+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
15+
aws-region: us-west-2
16+
17+
- name: Tests
18+
id: e2e-tests
19+
uses: aws-actions/aws-codebuild-run-build@v1
20+
with:
21+
project-name: gh-aws-sdk-kotlin-e2e-tests
22+
source-version-override: ${{ github.ref }}
23+
24+
- name: Cancel
25+
if: ${{ cancelled() }}
26+
env:
27+
BUILD_ID: ${{ steps.e2e-tests.outputs.aws-build-id }}
28+
run: |
29+
if [ ! -z "$BUILD_ID"]; then
30+
echo "Cancelling in-progress build: $BUILD_ID"
31+
aws codebuild stop-build --id $BUILD_ID
32+
fi
33+
34+
concurrency:
35+
group: ${{ github.ref }}
36+
cancel-in-progress: true
37+
38+
permissions:
39+
id-token: write
40+
contents: read
41+
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Release metrics
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
build-sdk:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Configure credentials
12+
uses: aws-actions/configure-aws-credentials@v4
13+
with:
14+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
15+
aws-region: us-west-2
16+
17+
- name: Build and upload metrics
18+
env:
19+
GITHUB_REPOSITORY: ${{ github.repository }}
20+
UPLOAD: 'true'
21+
RELEASE_METRICS: 'true'
22+
IDENTIFIER: 'null' # Only needed for pull requests
23+
uses: aws-actions/aws-codebuild-run-build@v1
24+
with:
25+
project-name: aws-sdk-kotlin-service-build
26+
source-version-override: ${{ github.ref }}
27+
env-vars-for-codebuild: GITHUB_REPOSITORY, UPLOAD, RELEASE_METRICS, IDENTIFIER
28+
29+
permissions:
30+
id-token: write
31+
contents: read

.github/workflows/service-ci.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Service CI
2+
3+
on:
4+
pull_request:
5+
workflow_dispatch:
6+
7+
jobs:
8+
build-sdk:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Configure credentials
12+
uses: aws-actions/configure-aws-credentials@v4
13+
with:
14+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
15+
aws-region: us-west-2
16+
17+
- name: Build and upload metrics
18+
id: build
19+
env:
20+
GITHUB_REPOSITORY: ${{ github.repository }}
21+
UPLOAD: 'true'
22+
RELEASE_METRICS: 'false'
23+
IDENTIFIER: ${{ github.ref_name }}
24+
uses: aws-actions/aws-codebuild-run-build@v1
25+
with:
26+
project-name: aws-sdk-kotlin-service-build
27+
source-version-override: ${{ github.ref }}
28+
env-vars-for-codebuild: GITHUB_REPOSITORY, UPLOAD, RELEASE_METRICS, IDENTIFIER
29+
30+
- name: Process metrics
31+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/download-and-process@main
32+
with:
33+
download: 'true'
34+
35+
- name: Cancel
36+
if: ${{ cancelled() }}
37+
env:
38+
BUILD_ID: ${{ steps.build.outputs.aws-build-id }}
39+
run: |
40+
if [ ! -z "$BUILD_ID"]; then
41+
echo "Cancelling in-progress build: id=$BUILD_ID"
42+
aws codebuild stop-build --id $BUILD_ID
43+
fi
44+
45+
concurrency:
46+
group: ${{ github.ref }}
47+
cancel-in-progress: true
48+
49+
permissions:
50+
id-token: write
51+
contents: read
52+

build.gradle.kts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ plugins {
3535
// ensure the correct version of KGP ends up on our buildscript classpath
3636
id(libs.plugins.kotlin.multiplatform.get().pluginId) apply false
3737
id(libs.plugins.kotlin.jvm.get().pluginId) apply false
38-
alias(libs.plugins.aws.kotlin.repo.tools.artifactsizemetrics)
39-
}
40-
41-
artifactSizeMetrics {
42-
artifactPrefixes = setOf(":services", ":aws-runtime")
43-
closurePrefixes = setOf(":services")
44-
significantChangeThresholdPercentage = 5.0
45-
projectRepositoryName = "aws-sdk-kotlin"
4638
}
4739

4840
val testJavaVersion = typedProp<String>("test.java.version")?.let {

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,5 +155,4 @@ kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", vers
155155
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp-version" }
156156
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.gradle.kmp", version.ref = "aws-kotlin-repo-tools-version" }
157157
aws-kotlin-repo-tools-smithybuild = { id = "aws.sdk.kotlin.gradle.smithybuild", version.ref = "aws-kotlin-repo-tools-version" }
158-
aws-kotlin-repo-tools-artifactsizemetrics = { id = "aws.sdk.kotlin.gradle.artifactsizemetrics", version.ref = "aws-kotlin-repo-tools-version" }
159158
gradle-plugin-publish = { id = "com.gradle.plugin-publish", version = "1.2.1"}

0 commit comments

Comments
 (0)