-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (49 loc) · 1.4 KB
/
test-module.yml
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
48
49
50
51
52
53
54
55
56
name: test-component
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
- ready_for_review
branches:
- main
paths:
- "**.tf"
- "**.go"
- ".github/**"
permissions:
id-token: write
contents: read
defaults:
run:
# We need -e -o pipefail for consistency with GitHub Actions' default behavior
shell: bash -e -o pipefail {0}
jobs:
terraform-test:
runs-on: ubuntu-latest
steps:
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4
with:
role-to-assume: ${{ secrets.AWS_COMMERCIAL_ROLE_TO_ASSUME }}
role-session-name: ${{ github.event.client_payload.pull_request.head.sha || github.sha }}
aws-region: us-east-1
# 21600 seconds == 6 hours
# 1800 seconds == 30 minutes
role-duration-seconds: 1800
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Setup Go from go.mod
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version-file: go.mod
- name: Install Go Dependencies and Test
shell: bash
working-directory: test
run: |
go mod tidy
go test -count 1 -timeout 30m -v .