-
Notifications
You must be signed in to change notification settings - Fork 9
65 lines (55 loc) · 1.58 KB
/
pr-workflow.yaml
File metadata and controls
65 lines (55 loc) · 1.58 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
name: PR Workflow
on:
pull_request:
types: [ synchronize, opened, reopened]
branches: [ 'main' ]
env:
TRIVY_DB_REPOSITORY: public.ecr.aws/aquasecurity/trivy-db:2
jobs:
linter:
name: Linter
runs-on: ubuntu-latest
timeout-minutes: 10 # Sets a timeout of 10 minutes for this job (default is 1 minute)
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: false
- name: Check Go Formatting
run: |
files=$(gofmt -l .) && echo $files && [ -z "$files" ]
- name: Golang CI Lint
uses: golangci/golangci-lint-action@v8
with:
version: v2.1.2 # Specify the golangci-lint version, so we are stable
args: --timeout 10m # Increase the timeout to 10 minutes
- name: Run Trivy vulnerability scanner in repo mode
uses: aquasecurity/trivy-action@master
with:
scan-type: 'fs'
exit-code: '1'
ignore-unfixed: true
format: 'table'
vuln-type: 'os,library'
severity: 'CRITICAL,HIGH'
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.24'
cache-dependency-path: go.sum
- name: Unit tests
run: |
make test_unit
- name: Setup BATS
uses: mig4/setup-bats@v1
with:
bats-version: 1.11.1
- name: Integration tests
run: make test_integration