generated from stackxcloud/template-terraform
-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.09 KB
/
test-weekly.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
name: test-weekly
on:
# cronjob trigger at 03:00 every monday.
schedule:
- cron: "0 3 * * MON"
# manual trigger
workflow_dispatch:
permissions:
id-token: write
contents: write
jobs:
test-weekly:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ steps.app-token.outputs.token }}
- name: Configure AWS credentials
if: ${{ env.AWS_DEFAULT_REGION }}
uses: aws-actions/configure-aws-credentials@v4
with:
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}
role-to-assume: ${{ secrets.AWS_GH_OIDC }}
- name: Set Versions
run: |
TFVER=$(grep .tool-versions -e "terraform" | sed "s/terraform \(.*\)/\1/")
echo "TFVERSION=$TFVER" >> $GITHUB_ENV
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: ${{ env.TFVERSION }}
- name: Terraform Init
id: init
run: terraform init
- name: Terraform Test
id: test
run: terraform test -verbose