Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #19

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b94d281
Delete .github/workflows/ci.yaml
0marperez Apr 22, 2024
635ef05
Delete .github/workflows/changelog-verification.yml
0marperez Apr 22, 2024
99c188d
Create artifact-size-metrics.yml
0marperez Apr 22, 2024
f63c9f5
Update settings.gradle.kts
0marperez Apr 22, 2024
c4e76c6
Update build.gradle.kts
0marperez Apr 22, 2024
8419257
Update build.gradle.kts
0marperez Apr 22, 2024
2eab81d
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
1576552
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
3c9b14e
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
b6f45bd
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
5278f0e
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
f5b9acb
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
b1ff5fb
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
6f62867
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
cc8e97d
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
684e00a
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
0d0c887
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
be85416
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
e0848a4
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
7ae3c7e
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
f21fd0c
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
b75f07b
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
459b79b
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
e57ed8d
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
0c78bb6
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
e1b78c3
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
ad60eb8
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
4cdcc01
Merge pull request #10 from 0marperez/0marperez-patch-1
0marperez Apr 22, 2024
fb5ec4a
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
8064aed
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
a1ea09d
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
17e5c9b
Merge pull request #11 from 0marperez/0marperez-patch-1
0marperez Apr 22, 2024
358da25
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
5cb243c
Merge pull request #13 from 0marperez/0marperez-patch-1
0marperez Apr 22, 2024
ba49440
Update artifact-size-metrics.yml
0marperez Apr 22, 2024
72947ee
Update artifact-size-metrics.yml
0marperez Apr 25, 2024
c9a0c8a
Update artifact-size-metrics.yml
0marperez Apr 25, 2024
666ca6d
Update artifact-size-metrics.yml
0marperez Apr 25, 2024
b29f54d
Update README.md
0marperez Apr 29, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 106 additions & 0 deletions .github/workflows/artifact-size-metrics.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Artifact Size Metrics
on:
pull_request:
types: [ opened, synchronize, reopened, labeled, unlabeled ]
branches: [ main ]
release:
types: [published]

permissions:
id-token: write
contents: read
pull-requests: write

jobs:
release-metrics:
if: github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- 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: Generate Artifact Size Metrics
run: ./gradlew artifactSizeMetrics
- name: Save Artifact Size Metrics
run: ./gradlew saveArtifactSizeMetrics
- name: Put Artifact Size Metrics in CloudWatch
run: ./gradlew putArtifactSizeMetricsInCloudWatch -Prelease=${{ github.event.release.tag_name }}
size-check:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- 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: Generate Artifact Size Metrics
run: ./gradlew artifactSizeMetrics
- name: Analyze Artifact Size Metrics
run: ./gradlew analyzeArtifactSizeMetrics
- name: Show Results
uses: actions/github-script@v7
with:
script: |
const getComments =
`query {
repository(owner:"${context.repo.owner}", name:"${context.repo.repo}"){
pullRequest(number: ${context.issue.number}) {
id
comments(last:100) {
nodes {
id
body
author {
login
}
isMinimized
}
}
}
}
}`

const response = await github.graphql(getComments)
const comments = response.repository.pullRequest.comments.nodes

const mutations = comments
.filter(comment => comment.author.login == 'github-actions' && !comment.isMinimized && comment.body.startsWith('Affected Artifacts'))
.map(comment =>
github.graphql(
`mutation {
minimizeComment(input:{subjectId:"${comment.id}", classifier:OUTDATED}){
clientMutationId
}
}`
)
)
await Promise.all(mutations)

const fs = require('node:fs')
const comment = fs.readFileSync('build/reports/metrics/artifact-analysis.md', 'utf8')

const writeComment =
`mutation {
addComment(input:{body:"""${comment}""", subjectId:"${response.repository.pullRequest.id}"}){
clientMutationId
}
}`

await github.graphql(writeComment)

- name: Evaluate
if: ${{ !contains(github.event.pull_request.labels.*.name, 'acknowledge-artifact-size-increase') }}
run: |
cd build/reports/metrics
cat has-significant-change.txt | grep false || {
echo An artifact increased in size by more than allowed or a new artifact was created.
echo If this is expected please add the 'acknowledge-artifact-size-increase' label to this pull request.
exit 1
}
24 changes: 0 additions & 24 deletions .github/workflows/changelog-verification.yml

This file was deleted.

65 changes: 0 additions & 65 deletions .github/workflows/ci.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## AWS CRT Kotlin
## AWS CRT Kotlin!

Kotlin bindings to the AWS Common Runtime

Expand Down
7 changes: 7 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ plugins {
id("org.jetbrains.kotlinx.binary-compatibility-validator") version "0.13.2"
alias(libs.plugins.kotlin.multiplatform) apply false
alias(libs.plugins.aws.kotlin.repo.tools.kmp)
id("artifact-size-metrics") version "0.4.2"
}

artifactSizeMetrics {
artifactPrefixes = setOf(":aws-crt-kotlin")
significantChangeThresholdPercentage = 5.0
projectRepositoryName = "aws-crt-kotlin"
}

allprojects {
Expand Down
3 changes: 0 additions & 3 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ pluginManagement {
maven {
name = "kotlinRepoTools"
url = java.net.URI("https://d2gys1nrxnjnyg.cloudfront.net/releases")
content {
includeGroupByRegex("""aws\.sdk\.kotlin.*""")
}
}
}
}
Expand Down
Loading