-
Notifications
You must be signed in to change notification settings - Fork 494
84 lines (70 loc) · 2.15 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
80
81
82
83
84
name: "Static Analysis"
on:
push:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
workflow_dispatch:
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Find required go version
id: go-version
run: |
set -euxo pipefail
echo "::set-output name=version::$(grep '^go ' go.mod | awk '{print $2}')"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
id: go
- name: Install Dependencies
run: |
echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV
echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2
- name: Download Dependencies
run: go mod download
- name: "Static Analysis: Copyright"
run: |
STATIC_ANALYSIS_JOB=test_copyright make static-analysis
shell: bash
- name: "Static Analysis: Shell Check"
run: |
STATIC_ANALYSIS_JOB=test_static_analysis_shell make static-analysis
shell: bash
- name: "Static Analysis: Go Check"
run: |
STATIC_ANALYSIS_JOB=test_static_analysis_go make static-analysis
shell: bash
- name: "Static Analysis: Python Check"
run: |
STATIC_ANALYSIS_JOB=test_static_analysis_python make static-analysis
shell: bash
schema:
name: Schema
runs-on: ubuntu-latest
if: github.event.pull_request.draft == false
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Find required go version
id: go-version
run: |
set -euxo pipefail
echo "::set-output name=version::$(grep '^go ' go.mod | awk '{print $2}')"
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: ${{ steps.go-version.outputs.version }}
id: go
- name: Schema Check
run: |
STATIC_ANALYSIS_JOB=test_schema make static-analysis
shell: bash