-
-
Notifications
You must be signed in to change notification settings - Fork 9
67 lines (54 loc) · 1.68 KB
/
ci.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
---
name: CI
on: pull_request
jobs:
fmt-validate:
runs-on: ubuntu-22.04
permissions:
contents: read
strategy:
matrix:
projects:
- ''
- 'examples/simple-repo/'
- 'examples/json-files/'
- 'examples/additional-claims/'
- 'examples/github-enterprise/'
- 'test'
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/[email protected]
- name: Terraform Format
id: fmt
run: terraform fmt -check
working-directory: "./${{ matrix.projects }}"
- name: Terraform Init
id: init
run: terraform init -input=false
working-directory: "./${{ matrix.projects }}"
- name: Terraform Validate
id: validate
run: terraform validate
working-directory: "./${{ matrix.projects }}"
pre-commit:
# Note that changing architectures will cause terraform_providers_lock to fail
runs-on: ubuntu-22.04
permissions:
contents: read
steps:
- uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/[email protected]
- name: Install Brew Packages
# Need Bash 5 for terraform fmt in pre-commit hook
# Nead realpath command for terraform_fmt which we get via coreutils
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
brew install actionlint bash coreutils terraform-docs tfsec pre-commit
- name: Run Pre-Commit
run: |
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
pre-commit --version
pre-commit run --all-files