generated from masterpointio/terraform-module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (42 loc) · 1.26 KB
/
tf-test.yaml
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
name: TF Test
on:
push:
branches:
- main
pull_request:
env:
SPACELIFT_API_KEY_ENDPOINT: ${{ secrets.SPACELIFT_API_KEY_ENDPOINT }}
SPACELIFT_API_KEY_ID: ${{ secrets.SPACELIFT_API_KEY_ID }}
SPACELIFT_API_KEY_SECRET: ${{ secrets.SPACELIFT_API_KEY_SECRET }}
permissions:
actions: read
checks: write
contents: read
id-token: write
pull-requests: read
jobs:
tf-test:
name: ${{ matrix.tf }} Test
runs-on: ubuntu-latest
strategy:
matrix:
tf: [tofu, terraform]
steps:
- uses: actions/checkout@v4
- name: Aqua Cache
uses: actions/cache@v4.2.0
if: ${{ !github.event.act }} # Don't enable the cache step if we're using act for testing
with:
path: ~/.local/share/aquaproj-aqua
key: v1-aqua-installer-${{runner.os}}-${{runner.arch}}-${{hashFiles('aqua.yaml')}}
restore-keys: |
v1-aqua-installer-${{runner.os}}-${{runner.arch}}-
- name: Install Aqua
uses: aquaproj/aqua-installer@f13c5d2f0357708d85477aabe50fd3f725528745 # v3.1.0
with:
aqua_version: v2.41.0
- name: Aqua Install
shell: bash
run: aqua install --tags ${{ matrix.tf }}
- run: ${{ matrix.tf }} init
- run: ${{ matrix.tf }} test