diff --git a/.github/workflows/codebuild-ci.yml b/.github/workflows/codebuild-ci.yml index a20ac4bb3ef..0951c5eff69 100644 --- a/.github/workflows/codebuild-ci.yml +++ b/.github/workflows/codebuild-ci.yml @@ -43,6 +43,9 @@ jobs: if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: + - name: Set start timestamp + id: start + run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT" - name: Verify PRs are not running malicious code if: ${{ (inputs.aws-sdk-kotlin-pr != '' || inputs.smithy-kotlin-pr != '') && inputs.check-pr == false }} run: | @@ -53,6 +56,8 @@ jobs: 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: Run E2E Tests id: e2e-tests uses: aws-actions/aws-codebuild-run-build@v1 @@ -68,11 +73,33 @@ jobs: echo "cancelling in-progress build: id=$BUILD_ID" aws codebuild stop-build --id $BUILD_ID fi + - 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 }} + Branch=${{ github.base_ref || github.ref_name }} + metrics: | + WorkflowSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count + WorkflowDuration:${{ steps.end.outputs.duration }}:Seconds service-check-batch-and-artifact-size-metrics: if: github.event_name == 'pull_request' || github.event_name == 'workflow_dispatch' runs-on: ubuntu-latest steps: + - name: Set start timestamp + id: start + run: printf 'timestamp=%(%s)T\n' >> "$GITHUB_OUTPUT" - name: Verify PRs are not running malicious code if: ${{ (inputs.aws-sdk-kotlin-pr != '' || inputs.smithy-kotlin-pr != '') && inputs.check-pr == false }} run: | @@ -85,6 +112,8 @@ jobs: 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 uses: aws/aws-kotlin-repo-tools/.github/actions/configure-gradle@main - name: Run Service Check Batch and Calculate Artifact Size Metrics @@ -155,6 +184,25 @@ jobs: echo If this is expected please add the 'acknowledge-artifact-size-increase' label to this pull request. exit 1 } + - 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 }} + Branch=${{ github.base_ref || github.ref_name }} + metrics: | + WorkflowSucceeded:${{ job.status == 'success' && '1' || '0' }}:Count + WorkflowDuration:${{ steps.end.outputs.duration }}:Seconds release-artifact-size-metrics: if: github.event_name == 'release' diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 8adadc7fa2c..da5eb187d8c 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -4,8 +4,9 @@ on: pull_request: workflow_dispatch: -permissions: { } - +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 }} @@ -29,6 +30,9 @@ jobs: - 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: @@ -39,6 +43,13 @@ jobs: 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 @@ -46,6 +57,25 @@ jobs: 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 @@ -60,12 +90,23 @@ jobs: 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: @@ -99,6 +140,26 @@ jobs: ./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 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index aeb94018585..08df17351d6 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ ksp-version = "2.2.0-2.0.2" # Keep in sync with kotlin-version dokka-version = "2.0.0" -aws-kotlin-repo-tools-version = "0.4.54" +aws-kotlin-repo-tools-version = "0.4.58" # libs coroutines-version = "1.10.2"