-
Notifications
You must be signed in to change notification settings - Fork 154
57 lines (47 loc) · 1.75 KB
/
check.yml
File metadata and controls
57 lines (47 loc) · 1.75 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
name: check
on:
pull_request:
types: [opened, synchronize]
merge_group:
types: [checks_requested]
push:
# Always run on push to main. The build cache can only be reused
# if it was saved by a run from the repository's default branch.
# The run result will be identical to that from the merge queue
# because the commit is identical, yet we need to perform it to
# seed the build cache.
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0
with:
go-version-file: go.mod
# Use different schema from regular job, to avoid overwriting the same key
cache-dependency-path: |
go.sum
.golangci.yaml
- name: Run go mod tidy
run: go mod tidy
- name: Fail if go.mod/go.sum changed
run: git diff --exit-code
- name: Run Go lint checks (does not include formatting checks)
run: go tool -modfile=tools/go.mod golangci-lint run --timeout=15m
- name: Run ruff (Python linter and formatter)
uses: astral-sh/ruff-action@57714a7c8a2e59f32539362ba31877a1957dded1 # v3.5.1
with:
version: "0.9.1"
args: "format --check"
- name: "make fmtfull: Python and Go formatting"
# Python formatting is already checked above, but this also checks Go and YAML formatting
# and verifies that the make command works correctly
run: |
make fmtfull
git diff --exit-code
- name: "make checks: custom checks outside of fmt and lint"
run: |-
make checks
git diff --exit-code