-
Notifications
You must be signed in to change notification settings - Fork 749
97 lines (94 loc) · 2.83 KB
/
workflow-tigron.yml
File metadata and controls
97 lines (94 loc) · 2.83 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
name: tigron
on:
push:
branches:
- main
- 'release/**'
pull_request:
paths: 'mod/tigron/**'
env:
GO_VERSION: "1.25"
GOTOOLCHAIN: local
jobs:
lint:
timeout-minutes: 15
name: "${{ matrix.goos }} ${{ matrix.runner }} | go ${{ matrix.canary }}"
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
matrix:
include:
- runner: ubuntu-24.04
- runner: macos-15
- runner: windows-2022
- runner: ubuntu-24.04
goos: freebsd
- runner: ubuntu-24.04
canary: go-canary
steps:
- name: "Checkout project"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 100
- if: ${{ matrix.canary }}
name: "Init (canary): retrieve GO_VERSION"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
latest_go="$(. ./hack/provisioning/version/fetch.sh; go::canary::for::go-setup)"
printf "GO_VERSION=%s\n" "$latest_go" >> "$GITHUB_ENV"
[ "$latest_go" != "" ] || \
echo "::warning title=No canary go::There is currently no canary go version to test. Steps will not run."
- if: ${{ env.GO_VERSION != '' }}
name: "Install go"
uses: actions/setup-go@4b73464bb391d4059bd26b0524d20df3927bd417 # v6.3.0
with:
go-version: ${{ env.GO_VERSION }}
check-latest: true
- if: ${{ env.GO_VERSION != '' }}
name: "Install tools"
run: |
cd mod/tigron
echo "::group:: make install-dev-tools"
make install-dev-tools
if [ "$RUNNER_OS" == macOS ]; then
brew install yamllint shellcheck
fi
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' && matrix.goos == '' }}
name: "lint"
env:
NO_COLOR: true
run: |
if [ "$RUNNER_OS" == Linux ]; then
echo "::group:: lint"
cd mod/tigron
export LINT_COMMIT_RANGE="$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})"
make lint
echo "::endgroup::"
else
echo "Lint is disabled on $RUNNER_OS"
fi
- if: ${{ env.GO_VERSION != '' }}
name: "test-unit"
run: |
echo "::group:: unit test"
cd mod/tigron
make test-unit
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' }}
name: "test-unit-race"
run: |
echo "::group:: race test"
cd mod/tigron
make test-unit-race
echo "::endgroup::"
- if: ${{ env.GO_VERSION != '' }}
name: "test-unit-bench"
run: |
echo "::group:: bench"
cd mod/tigron
make test-unit-bench
echo "::endgroup::"