Repository navigation
80 lines (73 loc) · 2.22 KB
/
Copy pathci.yml
File metadata and controls
80 lines (73 loc) · 2.22 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: ci
on:
push:
branches: [master]
pull_request:
# Each week, check the code against the new vulnerability reports.
schedule:
- cron: "0 6 * * 1"
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Rex runs only on macOS, so rexdiff is tested there.
test:
runs-on: macos-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- run: go vet ./...
# The tests in test/ time a real rexdiff. Beside the other packages
# under -race, they get too little CPU and time out. So run them alone.
- run: go test -race -count=1 $(go list ./... | grep -v '/test$')
- run: go test -race -count=1 ./test
# A second run in a random order finds a test that depends on another.
- run: go test -count=2 -shuffle=on ./diff/ ./vcs/ ./rex/ ./update/ ./internal/...
lint:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- name: go mod tidy
run: go mod tidy -diff
- name: go fix
run: test -z "$(go fix -diff ./... | tee /dev/stderr)"
- uses: golangci/golangci-lint-action@v9
with:
# Older releases cannot read the export data of a newer Go.
version: v2.15.0
govulncheck:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v7
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- run: go run golang.org/x/vuln/cmd/govulncheck@v1.9.0 ./...
goreleaser:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v7
with:
fetch-depth: 0
- uses: actions/setup-go@v7
with:
go-version-file: go.mod
- uses: goreleaser/goreleaser-action@v7
with:
version: "~> v2"
args: check
- uses: goreleaser/goreleaser-action@v7
with:
version: "~> v2"
args: build --snapshot --clean