-
Notifications
You must be signed in to change notification settings - Fork 184
116 lines (110 loc) · 3.43 KB
/
ci-build-tests.yml
File metadata and controls
116 lines (110 loc) · 3.43 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
on:
push:
branches:
- main
- v1.0.x
- v1.1.x
tags:
- 'v[0-9]+\.[0-9]+\.[0-9]+'
pull_request:
branches:
- main
- v1.0.x
- v1.1.x
name: CI Tests
concurrency:
group: ci-build-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- run: |
make check-codegen
- name: golangci-lint
uses: golangci/golangci-lint-action@v8
with:
version: latest
args: --timeout 5m
only-new-issues: true
docker:
runs-on: ubuntu-latest
steps:
- name: Get Build Date
id: builddate
run: |
echo "builddate=$(date -u +%Y-%m-%dT%H:%M:%SZ)" | tee $GITHUB_OUTPUT
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: build image
run: |
docker buildx build \
--label "org.opencontainers.image.revision=${{ github.sha }}" \
--label "org.opencontainers.image.source=https://github.com/${{ github.repository }}" \
--label "org.opencontainers.image.created=${{ steps.builddate.outputs.builddate }}" \
--platform linux/amd64 \
-f ./Dockerfile .
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
go: [1.26]
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install python dependencies
run: python -m pip install --upgrade pip setuptools wheel
- name: installing codespell
run: pip install codespell
- name: running codespell
run: codespell --skip="vendor,*.git,*.png,*.pdf,*.tiff,*.plist,*.pem,rangesim*.go,*.gz,go.mod,go.sum" --ignore-words="./testdata/ignore_words.txt"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/checkout@v4
- name: Get dependencies
run: |
go mod download
- run: go mod vendor
- name: Run tests
run: make test
- name: Run tests (with race detection enabled)
run: |
echo "::group::Race Detection Tests"
make data-race-test
echo "::endgroup::"
make data-race-test-inspect
- run: sed -i -e '/^.*_gen\.go:.*$/d' .coverprofile
- run: go build -o /dev/null ./cmd/trickster
- name: Send coverage
if: github.repository_owner == 'trickstercache' # Skip for forked repositories
uses: shogo82148/actions-goveralls@v1
# publishing to coveralls should not fail; and if it does, it should not block the CI process.
# Likely coveralls maintenance: https://status.coveralls.io/
# TODO: publish PR comment if coveralls publish fails
continue-on-error: true
with:
path-to-profile: .coverprofile
flag-name: Go-${{ matrix.go }}
parallel: true
finish:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
if: github.repository_owner == 'trickstercache' # Skip for forked repositories
continue-on-error: true
with:
parallel-finished: true