-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (84 loc) · 2.59 KB
/
Copy pathci.yml
File metadata and controls
92 lines (84 loc) · 2.59 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch: {}
permissions:
contents: read
jobs:
markup-lint:
name: Markup
uses: ./.github/workflows/reusable-markup-lint.yml
test-terraform-setup:
name: "Test / Terraform setup action"
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v7
- name: Install terraform
uses: ./actions/terraform/setup
- name: Verify terraform is installed
run: |
terraform version
command -v terraform
test-tflint-setup:
name: "Test / TFLint setup action"
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v7
- name: Setup TFLint
uses: ./actions/tflint/setup
- name: Verify tflint is installed
run: |
tflint --version
command -v tflint
test-syft-generate-sbom:
name: "Test / Syft generate-sbom action"
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v7
- name: Generate SBOM for this repository
uses: ./actions/syft/generate-sbom
with:
target-path: actions
output-file: sbom-test.spdx.json
upload-artifact: "false"
- name: Verify SBOM was generated
run: |
test -s sbom-test.spdx.json
grep -q '"spdxVersion"' sbom-test.spdx.json
test-trivy-scan:
name: "Test / Trivy scan action"
runs-on: ubuntu-latest
steps:
- name: Clone repository
uses: actions/checkout@v7
- name: Scan a real image with Trivy
uses: ./actions/trivy/scan
with:
scan-type: image
target: devprofr/terraform-backend-mongodb:latest
severity: CRITICAL,HIGH
exit-code: "0"
- name: Scan a directory with Trivy
uses: ./actions/trivy/scan
with:
scan-type: config
target: test/fixtures/terraform
format: sarif
output-file: trivy-test.sarif
severity: HIGH,CRITICAL
- name: Verify SARIF report was generated
run: test -s trivy-test.sarif
test-terraform-quality:
name: "Test / Terraform quality reusable workflow"
uses: ./.github/workflows/reusable-terraform-quality.yml
with:
working-directory: test/fixtures/terraform
# explicit override: for this same-repo local "./" call, github.workflow_sha's behavior is unverified,
# so pin to a ref we know is fetchable (branch on push, PR merge ref on PRs)
workflow-parts-version: ${{ github.ref }}