-
Notifications
You must be signed in to change notification settings - Fork 109
51 lines (44 loc) · 1.09 KB
/
main.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
name: CI/CD Pipeline
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: terraform-github-repository
cancel-in-progress: false
jobs:
pre-commit:
runs-on: ubuntu-latest
name: Static Analysis
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Run pre-commit
run: make test/docker/pre-commit
unit-tests:
needs: pre-commit
runs-on: ubuntu-latest
name: Unit Tests
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Check for Terraform file changes
uses: getsentry/paths-filter@v2
id: changes
with:
token: ${{ github.token }}
filters: |
terraform:
- '**/*.tf'
- '**/*.go'
- 'go.mod'
- 'go.sum'
- name: Run Unit Tests
if: steps.changes.outputs.terraform == 'true'
run: make test/docker/unit-tests
env:
GITHUB_OWNER: ${{ secrets.TEST_GITHUB_ORGANIZATION }}
GITHUB_TOKEN: ${{ secrets.TEST_GITHUB_TOKEN }}