Skip to content

Commit 6ca2837

Browse files
authored
misc: refactor artifact size metrics (#1434)
1 parent f169b9f commit 6ca2837

File tree

5 files changed

+77
-94
lines changed

5 files changed

+77
-94
lines changed

.github/workflows/artifact-size-metrics.yml

Lines changed: 0 additions & 86 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Pull request metrics
2+
on:
3+
pull_request:
4+
5+
jobs:
6+
artifact-size-metrics:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
11+
12+
- name: Configure Gradle
13+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
14+
15+
- name: Build
16+
shell: bash
17+
run: |
18+
./gradlew build --parallel
19+
./gradlew publishAllPublicationsToTestLocalRepository --parallel
20+
21+
- name: Calculate metrics
22+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/calculate-and-upload@main
23+
with:
24+
upload: 'false'
25+
release_metrics: 'false'
26+
27+
- name: Configure credentials
28+
uses: aws-actions/configure-aws-credentials@v4
29+
with:
30+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
31+
aws-region: us-west-2
32+
33+
- name: Process metrics
34+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/download-and-process@main
35+
with:
36+
download: 'false'
37+
38+
permissions:
39+
id-token: write
40+
contents: read
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Release metrics
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
7+
jobs:
8+
artifact-size-metrics:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout repository
12+
uses: actions/checkout@v4
13+
14+
- name: Configure Gradle
15+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/configure-gradle@main
16+
17+
- name: Build
18+
shell: bash
19+
run: |
20+
./gradlew build --parallel
21+
./gradlew publishAllPublicationsToTestLocalRepository --parallel
22+
23+
- name: Configure credentials
24+
uses: aws-actions/configure-aws-credentials@v4
25+
with:
26+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
27+
aws-region: us-west-2
28+
29+
- name: Calculate and upload metrics
30+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/calculate-and-upload@main
31+
with:
32+
upload: 'true'
33+
release_metrics: 'true'
34+
35+
permissions:
36+
id-token: write
37+
contents: read

build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,19 +41,12 @@ buildscript {
4141
plugins {
4242
`dokka-convention`
4343
alias(libs.plugins.kotlinx.binary.compatibility.validator)
44-
alias(libs.plugins.aws.kotlin.repo.tools.artifactsizemetrics)
4544
// ensure the correct version of KGP ends up on our buildscript classpath
4645
// since build-plugins also has <some> version in its dependency closure
4746
id(libs.plugins.kotlin.multiplatform.get().pluginId) apply false
4847
id(libs.plugins.kotlin.jvm.get().pluginId) apply false
4948
}
5049

51-
artifactSizeMetrics {
52-
artifactPrefixes = setOf(":runtime")
53-
significantChangeThresholdPercentage = 5.0
54-
projectRepositoryName = "smithy-kotlin"
55-
}
56-
5750
val testJavaVersion = typedProp<String>("test.java.version")?.let {
5851
JavaLanguageVersion.of(it)
5952
}?.also {

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,4 +118,3 @@ kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-co
118118
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin-version"}
119119
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.gradle.kmp", version.ref = "aws-kotlin-repo-tools-version" }
120120
aws-kotlin-repo-tools-smithybuild = { id = "aws.sdk.kotlin.gradle.smithybuild", version.ref = "aws-kotlin-repo-tools-version" }
121-
aws-kotlin-repo-tools-artifactsizemetrics = { id = "aws.sdk.kotlin.gradle.artifactsizemetrics", version.ref = "aws-kotlin-repo-tools-version" }

0 commit comments

Comments
 (0)