-
-
Notifications
You must be signed in to change notification settings - Fork 1
131 lines (119 loc) · 4.28 KB
/
Copy pathbasic.yml
File metadata and controls
131 lines (119 loc) · 4.28 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: basic
# Note: this currently does not run on Windows environments, as mingw/make does mess up the path
# preventing golangci-lint from finding go.
# Also note that the arm runner does not come with yamllint installed.
# This does not matter much for now, as lint tasks are designed to execute for all required OS/ARCH targets.
on:
push:
branches:
- main
- 'release/**'
pull_request:
jobs:
env:
name: "init"
uses: ./.github/workflows/environment.yml
lint:
needs: env
# FIXME: windows 2022 is horribly slow restoring cache for mods...
# Should disable cache for that
timeout-minutes: ${{ fromJSON(needs.env.outputs.TIMEOUT_LONG) }}
name: lint | go ${{ matrix.go}} | ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- runner: ${{ needs.env.outputs.RUNNER_LINUX_STABLE }}
go: ${{ needs.env.outputs.GO_STABLE }}
- runner: ${{ needs.env.outputs.RUNNER_LINUX_CANARY }}
go: ${{ needs.env.outputs.GO_CANARY }}
steps:
- name: "Clone"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
with:
fetch-depth: 100
- name: "Setup"
uses: ./.github/actions/node
with:
go-version: ${{ matrix.go }}
- name: "Linting"
run: |
# FIXME: right now, go-licenses is broken on canary.
export LINT_COMMIT_RANGE="$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})"
if [ "${{ matrix.go }}" == "${{ needs.env.outputs.GO_STABLE }}" ]; then
make lint
else
# For some reason, go-licenses does not work on canary
# Presumably because of https://github.com/google/go-licenses/blob/master/licenses/library.go#L421
make lint-go-all
fi
unit:
needs: env
timeout-minutes: ${{ fromJSON(needs.env.outputs.TIMEOUT_SHORT) }}
name: unit | go ${{ matrix.go }} | ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- runner: ${{ needs.env.outputs.RUNNER_WINDOWS_STABLE }}
go: ${{ needs.env.outputs.GO_STABLE }}
- runner: ${{ needs.env.outputs.RUNNER_LINUX_STABLE }}
go: ${{ needs.env.outputs.GO_STABLE }}
- runner: ${{ needs.env.outputs.RUNNER_LINUX_CANARY }}
go: ${{ needs.env.outputs.GO_CANARY }}
steps:
- name: "Clone"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: "Setup"
uses: ./.github/actions/node
with:
go-version: ${{ matrix.go }}
# FIXME: caching? Takes ~30s
- name: "Setup CNI"
run: |
[ "$RUNNER_OS" != Windows ] || GOPATH=$(go env GOPATH) ./hack/provisioning/windows/cni.sh ${{ needs.env.outputs.WINCNI_VERSION }}
- name: "Unit testing"
run: |
make test-unit
build:
needs: env
timeout-minutes: ${{ fromJSON(needs.env.outputs.TIMEOUT_SHORT) }}
name: build | go ${{ matrix.go }} | ${{ matrix.runner }}
runs-on: ${{ matrix.runner }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
include:
- runner: ${{ needs.env.outputs.RUNNER_WINDOWS_STABLE }}
go: ${{ needs.env.outputs.GO_STABLE }}
- runner: ${{ needs.env.outputs.RUNNER_LINUX_AMD64_STABLE }}
go: ${{ needs.env.outputs.GO_STABLE }}
- runner: ${{ needs.env.outputs.RUNNER_LINUX_ARM64_STABLE }}
go: ${{ needs.env.outputs.GO_STABLE }}
- runner: ${{ needs.env.outputs.RUNNER_WINDOWS_CANARY }}
go: ${{ needs.env.outputs.GO_CANARY }}
- runner: ${{ needs.env.outputs.RUNNER_LINUX_CANARY }}
go: ${{ needs.env.outputs.GO_CANARY }}
steps:
- name: "Clone"
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
- name: "Setup"
uses: ./.github/actions/node
with:
go-version: ${{ matrix.go }}
- name: "Building"
run: |
GOOS=linux GOARCH=amd64 make build
GOOS=linux GOARCH=arm64 make build
GOOS=windows make build