-
Notifications
You must be signed in to change notification settings - Fork 0
79 lines (66 loc) · 2.17 KB
/
static-analysis.yml
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
name: "Static Analysis"
on:
push:
branches: [2.*, 3.*, 4.*, main]
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
# paths:
# DON'T SET - these are "required" so they need to run on every PR
workflow_dispatch:
permissions:
contents: read
jobs:
checks:
name: Checks
runs-on: [self-hosted, linux, arm64, aws, quad-xlarge]
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
- name: Install Dependencies
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
sudo add-apt-repository ppa:dqlite/dev -y --no-update
sudo apt-get update
sudo apt-get install -y \
expect \
libdqlite-dev \
libsqlite3-dev \
sqlite3
go install golang.org/x/vuln/cmd/govulncheck@latest
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.61.0
sudo curl -sSfL https://github.com/mvdan/sh/releases/download/v3.7.0/shfmt_v3.7.0_linux_$(go env GOARCH) -o /usr/bin/shfmt
sudo chmod +x /usr/bin/shfmt
go install github.com/google/go-licenses@latest
- name: Download Go Dependencies
run: go mod download
- name: "Static Analysis"
run: make static-analysis
sql:
name: SQL
runs-on: [self-hosted, linux, x64, aws, large]
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: "actions/setup-python@v5"
with:
python-version: "3.9"
- name: Install SQLFluff
run: "pip install sqlfluff==3.0.7"
- name: Lint SQL
run: "sqlfluff lint --config .github/.sqlfluff domain/schema/**/sql/*.sql"
conventional-commits:
name: Check conventional commits
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: wagoid/commitlint-github-action@v6
with:
configFile: .github/commitlint.config.mjs