Skip to content

Commit fbbc4b8

Browse files
committed
Get integration test configuration directly from a GitHub Actions variable
1 parent 74ee1c8 commit fbbc4b8

File tree

2 files changed

+24
-8
lines changed

2 files changed

+24
-8
lines changed

.github/workflows/integration-tests.yml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,33 @@ on:
55
- cron: '30 19 * * MON-FRI'
66
workflow_dispatch:
77

8+
env:
9+
# This may seem a little redundant, but copying the configuration to an environment variable makes it easier and safer
10+
# to then write its contents to a file
11+
INTEGRATION_TEST_CONFIG: ${{ vars.INTEGRATION_TEST_CONFIG }}
12+
813
jobs:
914
build:
10-
if: ${{ vars.INTEGRATION_TESTS_BUCKET != '' }}
15+
if: ${{ vars.INTEGRATION_TEST_CONFIG != '' }}
1116
runs-on: ubuntu-latest
1217
permissions:
1318
id-token: write
1419
contents: read
1520
steps:
1621
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17-
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 # v4.7.0
22+
- uses: actions/setup-java@c5195efecf7bdfc987ee8bae7a71cb8b11521c00 # v4.7.1
1823
with:
1924
distribution: 'temurin'
2025
java-version: '21'
2126
cache: 'maven'
22-
- uses: aws-actions/configure-aws-credentials@ececac1a45f3b08a01d2dd070d28d111c5fe6722 # v4.1.0
27+
- uses: aws-actions/configure-aws-credentials@b47578312673ae6fa5b5096b330d9fbac3d116df # v4.2.1
2328
name: Configure AWS credentials from Test account
2429
with:
2530
role-to-assume: ${{ vars.AWS_ROLE }}
2631
aws-region: ${{ vars.AWS_REGION }}
27-
- name: Fetch integration utils library
32+
- name: Write integration test configuration
2833
run: |
29-
mkdir -p integration-tests/.libs
3034
mkdir -p integration-tests/src/main/resources
31-
wget -O integration-tests/.libs/software.amazon.awssdk-sso.jar https://repo1.maven.org/maven2/software/amazon/awssdk/sso/2.19.8/sso-2.19.8.jar
32-
aws s3 cp "s3://${{ vars.INTEGRATION_TESTS_BUCKET }}/config-latest.yml" integration-tests/src/main/resources/config.yml
35+
echo "${INTEGRATION_TEST_CONFIG}" > integration-tests/src/main/resources/config.yml
3336
- name: Run and verify integration tests
34-
run: ./mvnw clean compile test-compile failsafe:integration-test failsafe:verify
37+
run: ./mvnw clean compile test-compile failsafe:integration-test failsafe:verify -P aws-sso

integration-tests/pom.xml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,4 +57,17 @@
5757
</plugin>
5858
</plugins>
5959
</build>
60+
61+
<profiles>
62+
<profile>
63+
<id>aws-sso</id>
64+
65+
<dependencies>
66+
<dependency>
67+
<groupId>software.amazon.awssdk</groupId>
68+
<artifactId>sso</artifactId>
69+
</dependency>
70+
</dependencies>
71+
</profile>
72+
</profiles>
6073
</project>

0 commit comments

Comments
 (0)