-
Notifications
You must be signed in to change notification settings - Fork 4
68 lines (64 loc) · 1.7 KB
/
ci-pull-request.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
68
name: CI - Pull Request
on:
pull_request:
branches:
- master
env:
GO_VERSION: "^1.20"
jobs:
format:
name: Format
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- uses: hashicorp/setup-terraform@v2
- run: make fmt
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Lint
run: make lint
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
strategy:
matrix:
example:
- "secure_config_posture_identity_access/single/main.tf"
- "secure_config_posture_identity_access/organization/main.tf"
- "secure_threat_detection/single/main.tf"
- "secure_threat_detection/organization/main.tf"
- "agentless-scan/single/main.tf"
- "agentless-scan/organization/main.tf"
steps:
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: ${{ env.GO_VERSION }}
- name: Check out code
uses: actions/checkout@v2
- name: Cache modules
uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get dependencies
run: |
go install github.com/onsi/ginkgo/ginkgo@latest
# Check if we need to build any go packages in this repo. If not, remove below.
# - name: Build
# run: go build ./...
- name: Test
env:
EXAMPLES: examples/${{ matrix.example }}
run: make test