forked from awslabs/mountpoint-s3-csi-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 1.54 KB
/
linting-and-formatting.yaml
File metadata and controls
59 lines (51 loc) · 1.54 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
name: Linting and Formatting
on:
push:
branches:
- main
pull_request:
branches:
- '**'
jobs:
code-quality-checks:
name: Run
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test: [precommit, lint]
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: 'go.mod'
cache: true
- name: Set up Python and install pre-commit (for precommit test)
uses: actions/setup-python@v6
with:
python-version: '3.x'
cache: pip
- name: Install pre-commit
run: pip install -r requirements.txt
- name: Download tools (for precommit test)
if: matrix.test == 'precommit'
run: |
curl -L https://github.com/lycheeverse/lychee/releases/download/lychee-v0.18.1/lychee-x86_64-unknown-linux-gnu.tar.gz -o lychee.tar.gz
tar -xzf lychee.tar.gz
sudo mv lychee /usr/local/bin/lychee
lychee --version
go install golang.org/x/tools/cmd/goimports@latest
go install mvdan.cc/gofumpt@latest
- name: Run ${{ matrix.test }}
run: make ${{ matrix.test }}
env:
# Skip golangci-lint hooks in precommit test since we run them separately in the 'lint' job
# This saves 4 mins of CI time
SKIP: ${{ matrix.test == 'precommit' && 'golangci-lint' || '' }}
- name: Run golangci-lint
if: matrix.test == 'lint'
uses: golangci/golangci-lint-action@v9
with:
version: v2.4.0