Skip to content

Commit c8acab0

Browse files
ci: onboard the repo to the testing infra
1 parent 0d302a4 commit c8acab0

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

.github/workflows/aws-ci.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: AWS CI
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
branches:
7+
- master
8+
- dev
9+
- 'feature/**'
10+
11+
permissions:
12+
id-token: write
13+
14+
jobs:
15+
run-ci:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Configure AWS Credentials
19+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 #v4
20+
with:
21+
role-to-assume: ${{ secrets.CI_MAIN_TESTING_ACCOUNT_ROLE_ARN }}
22+
role-duration-seconds: 7200
23+
aws-region: us-west-2
24+
- name: Invoke Load Balancer Lambda
25+
id: lambda
26+
shell: pwsh
27+
run: |
28+
aws lambda invoke response.json --function-name "${{ secrets.CI_TESTING_LOAD_BALANCER_LAMBDA_NAME }}" --cli-binary-format raw-in-base64-out --payload '{"Roles": "${{ secrets.CI_TEST_RUNNER_ACCOUNT_ROLES }}", "ProjectName": "${{ secrets.CI_TESTING_CODE_BUILD_PROJECT_NAME }}", "Branch": "${{ github.sha }}"}'
29+
$roleArn=$(cat ./response.json)
30+
"roleArn=$($roleArn -replace '"', '')" >> $env:GITHUB_OUTPUT
31+
- name: Configure Test Runner Credentials
32+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 #v4
33+
with:
34+
role-to-assume: ${{ steps.lambda.outputs.roleArn }}
35+
role-duration-seconds: 7200
36+
aws-region: us-west-2
37+
- name: Run Tests on AWS
38+
id: codebuild
39+
uses: aws-actions/aws-codebuild-run-build@v1
40+
with:
41+
project-name: ${{ secrets.CI_TESTING_CODE_BUILD_PROJECT_NAME }}
42+
- name: CodeBuild Link
43+
shell: pwsh
44+
run: |
45+
$buildId = "${{ steps.codebuild.outputs.aws-build-id }}"
46+
echo $buildId

buildtools/ci.buildspec.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 0.2
2+
3+
phases:
4+
install:
5+
runtime-versions:
6+
dotnet: 8.x
7+
build:
8+
commands:
9+
- dotnet test test/Amazon.Extensions.Configuration.SystemsManager.Tests/Amazon.Extensions.Configuration.SystemsManager.Tests.csproj -c Release --logger trx --results-directory ./testresults
10+
- dotnet test test/Amazon.Extensions.Configuration.SystemsManager.Integ/Amazon.Extensions.Configuration.SystemsManager.Integ.csproj -c Release --logger trx --results-directory ./testresults
11+
reports:
12+
aws-ssm-data-protection-provider-for-aspnet-tests:
13+
file-format: VisualStudioTrx
14+
files:
15+
- '**/*'
16+
base-directory: './testresults'

0 commit comments

Comments
 (0)