Skip to content

Commit 5ed7fb7

Browse files
authored
misc: refactor artifact size metrics (#202)
1 parent 7ba57dc commit 5ed7fb7

File tree

5 files changed

+79
-73
lines changed

5 files changed

+79
-73
lines changed

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

Lines changed: 0 additions & 65 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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+
echo "FIXME: Enable K/N builds - then capture KN artifact metrics"
19+
./gradlew -Paws.kotlin.native=false build --parallel
20+
./gradlew -Paws.kotlin.native=false publishAllPublicationsToTestLocalRepository --parallel
21+
22+
- name: Calculate metrics
23+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/calculate-and-upload@main
24+
with:
25+
upload: 'false'
26+
release_metrics: 'false'
27+
28+
- name: Configure credentials
29+
uses: aws-actions/configure-aws-credentials@v4
30+
with:
31+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
32+
aws-region: us-west-2
33+
34+
- name: Process metrics
35+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/download-and-process@main
36+
with:
37+
download: 'false'
38+
39+
permissions:
40+
id-token: write
41+
contents: read
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
echo "FIXME: Enable K/N builds - then capture KN artifact metrics"
21+
./gradlew -Paws.kotlin.native=false build --parallel
22+
./gradlew -Paws.kotlin.native=false publishAllPublicationsToTestLocalRepository --parallel
23+
24+
- name: Configure credentials
25+
uses: aws-actions/configure-aws-credentials@v4
26+
with:
27+
role-to-assume: ${{ secrets.CI_AWS_ROLE_ARN }}
28+
aws-region: us-west-2
29+
30+
- name: Calculate and upload metrics
31+
uses: awslabs/aws-kotlin-repo-tools/.github/actions/artifact-size-metrics/calculate-and-upload@main
32+
with:
33+
upload: 'true'
34+
release_metrics: 'true'
35+
36+
permissions:
37+
id-token: write
38+
contents: read

build.gradle.kts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,6 @@ plugins {
2525
alias(libs.plugins.kotlinx.binary.compatibility.validator)
2626
alias(libs.plugins.kotlin.multiplatform) apply false
2727
alias(libs.plugins.aws.kotlin.repo.tools.kmp)
28-
alias(libs.plugins.aws.kotlin.repo.tools.artifactsizemetrics)
29-
}
30-
31-
artifactSizeMetrics {
32-
artifactPrefixes = setOf(":aws-crt-kotlin")
33-
significantChangeThresholdPercentage = 5.0
34-
projectRepositoryName = "aws-crt-kotlin"
3528
}
3629

3730
allprojects {

gradle/libs.versions.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,3 @@ mockserver-netty = { module = "org.mock-server:mockserver-netty", version.ref =
3434
kotlin-multiplatform = {id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin-version" }
3535
kotlinx-binary-compatibility-validator = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version.ref = "binary-compatibility-validator-version" }
3636
aws-kotlin-repo-tools-kmp = { id = "aws.sdk.kotlin.gradle.kmp", version.ref = "aws-kotlin-repo-tools-version" }
37-
aws-kotlin-repo-tools-artifactsizemetrics = { id = "aws.sdk.kotlin.gradle.artifactsizemetrics", version.ref = "aws-kotlin-repo-tools-version" }

0 commit comments

Comments
 (0)