-
Notifications
You must be signed in to change notification settings - Fork 40
114 lines (96 loc) · 2.59 KB
/
pr-checks.yml
File metadata and controls
114 lines (96 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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
name: PR checks
on:
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
permissions:
contents: read
concurrency:
group: pr-checks-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
secret-scan:
name: Secret scan
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Scan committed files for secrets
run: |
docker run --rm \
-v "$PWD:/repo" \
ghcr.io/gitleaks/gitleaks:v8.30.1 \
dir --no-banner --redact=100 --verbose /repo
backend:
name: Backend build and test
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: backend/go.mod
cache-dependency-path: |
backend/go.mod
backend/go.sum
- name: Verify Go modules
working-directory: backend
run: go mod verify
- name: Scan Go vulnerabilities
working-directory: backend
run: go run golang.org/x/vuln/cmd/govulncheck@v1.3.0 ./...
- name: Vet backend
working-directory: backend
run: go vet ./...
- name: Test backend
working-directory: backend
run: go test ./...
- name: Build backend
working-directory: backend
run: |
mkdir -p dist
go build -o dist/mergeos ./cmd/mergeos
web:
name: Web build and test (${{ matrix.app }})
runs-on: ubuntu-latest
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
app:
- frontend
- admin
- scan
steps:
- name: Checkout
uses: actions/checkout@v6
with:
persist-credentials: false
- name: Set up Node
uses: actions/setup-node@v6
with:
node-version: 22
cache: npm
cache-dependency-path: ${{ matrix.app }}/package-lock.json
- name: Install dependencies
working-directory: ${{ matrix.app }}
run: npm ci
- name: Audit npm dependencies
working-directory: ${{ matrix.app }}
run: npm audit --audit-level=high
- name: Test app
working-directory: ${{ matrix.app }}
run: npm test --if-present
- name: Build app
working-directory: ${{ matrix.app }}
run: npm run build