Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
18 changes: 17 additions & 1 deletion .github/actions/setup-kat/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,26 @@ description: >
runs:
using: composite
steps:
- name: Install AWS CLI
- name: Install AWS CLI (ubuntu)
if: runner.os == 'Linux'
shell: bash
run: |
sudo snap install aws-cli --classic

- name: Install AWS CLI (macOS)
if: runner.os == 'macOS'
shell: bash
run: |
curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
sudo installer -pkg AWSCLIV2.pkg -target /

- name: Install AWS CLI (Windows)
if: runner.os == 'Windows'
shell: powershell
run: |
Invoke-WebRequest -Uri "https://awscli.amazonaws.com/AWSCLIV2.msi" -OutFile "AWSCLIV2.msi"
Start-Process msiexec.exe -Wait -ArgumentList '/I AWSCLIV2.msi /quiet'

- name: Set up kat
shell: bash
run: |
Expand Down
76 changes: 75 additions & 1 deletion .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:
- 'feat-*'
workflow_dispatch:

permissions: { }
permissions:
id-token: write
contents: read

env:
PACKAGE_NAME: aws-kotlin-repo-tools
Expand All @@ -29,6 +31,14 @@ jobs:
java-version: 17
cache: 'gradle'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::934480575838:role/aws-sdk-kotlin-pr-github-oidc-role
aws-region: us-west-2
- name: Setup Kat
uses: ./.github/actions/setup-kat

- uses: actions/cache@v4
with:
path: |
Expand All @@ -46,6 +56,11 @@ jobs:
macos-compat:
runs-on: macos-latest
steps:
- name: Set start timestamp
id: start
shell: bash
run: echo "timestamp=$(date +%s)" >> "$GITHUB_OUTPUT"

- name: Checkout sources
uses: actions/checkout@v2

Expand All @@ -56,6 +71,14 @@ jobs:
java-version: 17
cache: 'gradle'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::934480575838:role/aws-sdk-kotlin-pr-github-oidc-role
aws-region: us-west-2
- name: Setup Kat
uses: ./.github/actions/setup-kat

- uses: actions/cache@v4
with:
path: |
Expand All @@ -69,10 +92,33 @@ jobs:
- name: Build and Test ${{ env.PACKAGE_NAME }}
run: |
./gradlew build
- name: Calculate duration
id: end
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-kotlin-repo-tools
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

windows-compat:
runs-on: windows-latest
steps:
- name: Set start timestamp
id: start
shell: bash
run: echo "timestamp=$(date +%s)" >> "$GITHUB_OUTPUT"
- name: Checkout sources
uses: actions/checkout@v2

Expand All @@ -83,8 +129,36 @@ jobs:
java-version: 17
cache: 'gradle'

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::934480575838:role/aws-sdk-kotlin-pr-github-oidc-role
aws-region: us-west-2
- name: Setup Kat
uses: ./.github/actions/setup-kat

- name: Configure Gradle
uses: ./.github/actions/configure-gradle
- name: Build and Test ${{ env.PACKAGE_NAME }}
run: |
./gradlew build

- name: Calculate duration
id: end
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-kotlin-repo-tools
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
Loading