-
Notifications
You must be signed in to change notification settings - Fork 199
58 lines (48 loc) · 1.91 KB
/
Copy pathcheck.yml
File metadata and controls
58 lines (48 loc) · 1.91 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
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@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
- uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.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: Install uv
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
version: "0.8.9"
- name: Run Go and Python lint checks (does not include formatting checks)
# `task lint` runs golangci-lint and `ruff check` (lint-python). ruff is
# provided by uvx, installed above; formatting is checked by `task fmt` below.
run: go tool -modfile=tools/task/go.mod task lint
- name: "task fmt: Python, Go and YAML formatting"
# `task fmt` runs ruff format (Python) plus Go and YAML formatters; the diff
# check fails the build if anything was left unformatted.
run: |
go tool -modfile=tools/task/go.mod task fmt
git diff --exit-code
- name: "task checks: custom checks outside of fmt and lint"
run: |-
go tool -modfile=tools/task/go.mod task checks
git diff --exit-code