forked from k8sgateway/k8sgateway
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (52 loc) · 1.89 KB
/
static-analysis.yaml
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
name: Static Code Analysis
on:
pull_request: { }
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
codegen:
name: Generated Code
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
- name: Install Protoc
uses: arduino/setup-protoc@v1
with:
version: "3.6.1"
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Generate Code
run: |
./ci/check-generated-code.sh
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
- name: Check for DO_NOT_SUBMIT
# documentation for where we get the list of files to pass into the script:
# https://github.com/marketplace/actions/changed-files?version=v37#outputs
run: ./ci/do-not-submit.sh ${{ steps.changed-files.outputs.all_changed_files }}
static-analysis:
name: Lint Checks
runs-on: ubuntu-22.04
# The linter is intended to run quickly.
# We define a 10-minute timeout on the linter config (.golangci.yaml) as well.
# If we exceed this timeout, we should consider only running the linter on changed files.
timeout-minutes: 10
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Prep Go Runner
uses: ./.github/workflows/composite-actions/prep-go-runner
- uses: golangci/golangci-lint-action@v6
# `make analyze` runs the linter with similar arguments to what we use here.
# If this action fails, try running `make analyze` locally.
with:
version: v1.57.2
args: --verbose --modules-download-mode=readonly --allow-parallel-runners
skip-cache: true
skip-save-cache: true
only-new-issues: false