-
Notifications
You must be signed in to change notification settings - Fork 78
47 lines (47 loc) · 1.79 KB
/
integration-aws.yaml
File metadata and controls
47 lines (47 loc) · 1.79 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: integration-aws
on:
workflow_dispatch:
jobs:
test-aws:
runs-on: ubuntu-latest
permissions:
contents: read # for reading the repository code.
id-token: write # for obtaining AWS OIDC federated credential.
defaults:
run:
working-directory: ./tests/integration
steps:
- name: Test suite setup
uses: fluxcd/gha-workflows/.github/actions/setup-kubernetes@v0.9.0
with:
go-version: 1.26.x
- name: Setup Terraform
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@a03048d87541d1d9fcf2ecf528a4a65ba9bd7838 # v5.0.0
with:
role-to-assume: arn:aws:iam::${{ secrets.AWS_ACCOUNT_ID }}:role/${{ secrets.IRC_E2E_AWS_ASSUME_ROLE_NAME }}
role-session-name: IRC_GH_Actions
aws-region: ${{ vars.AWS_REGION }}
- name: Set dynamic variables in .env
run: |
cat > .env <<EOF
export TF_VAR_rand=${RANDOM}
export TF_VAR_tags='{"environment"="github", "ci"="true", "repo"="image-reflector-controller", "createdat"="$(date -u +x%Y-%m-%d_%Hh%Mm%Ss)"}'
EOF
- name: Print .env for dynamic tag value reference
run: cat .env
- name: Build controller
run: |
make docker-build IMG=fluxcd/image-reflector-controller:dev \
BUILD_PLATFORMS=linux/amd64
working-directory: ./
- name: Run tests
run: . .env && make test-aws TEST_IMG=fluxcd/image-reflector-controller:dev
env:
AWS_REGION: ${{ vars.AWS_REGION }}
- name: Ensure resource cleanup
if: ${{ always() }}
run: . .env && make destroy-aws
env:
AWS_REGION: ${{ vars.AWS_REGION }}