-
Notifications
You must be signed in to change notification settings - Fork 0
98 lines (82 loc) · 2.25 KB
/
ci.yml
File metadata and controls
98 lines (82 loc) · 2.25 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: CI
on:
push:
branches: [master]
pull_request:
branches: [master]
permissions:
contents: read
jobs:
lint:
name: Lint
runs-on: blacksmith-2vcpu-ubuntu-2404
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: latest
test:
name: Test
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [blacksmith-2vcpu-ubuntu-2404, macos-latest, windows-latest]
go: ['1.24']
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go }}
- name: Download dependencies
run: go mod download
- name: Run tests (Unix)
if: runner.os != 'Windows'
run: go test -v -race -coverprofile=coverage.out ./...
- name: Run tests (Windows)
if: runner.os == 'Windows'
run: go test -v -race ./...
- name: Upload coverage
if: matrix.os == 'blacksmith-2vcpu-ubuntu-2404'
uses: codecov/codecov-action@v6
with:
files: ./coverage.out
flags: unittests
fail_ci_if_error: false
# Summary job for matrix test runs. GitHub requires a single check for branch protection,
# but matrix jobs create multiple checks. This job provides a single "Check Tests Passed"
# status that succeeds only if all matrix test jobs succeed.
validate-tests-passed:
name: Check Tests Passed
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: test
if: always()
steps:
- name: Check test matrix status
if: needs.test.result != 'success'
run: exit 1
build:
name: Build
runs-on: blacksmith-2vcpu-ubuntu-2404
needs: [lint, test]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: Build
run: make build-all
- name: Verify binary
run: ./bin/rootly version