-
Notifications
You must be signed in to change notification settings - Fork 48
93 lines (86 loc) · 2.88 KB
/
test.yml
File metadata and controls
93 lines (86 loc) · 2.88 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
name: Test
# Default to 'contents: read', which grants actions to read commits.
#
# If any permission is set, any permission not included in the list is
# implicitly set to "none".
#
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]
jobs:
test:
strategy:
matrix:
go-version: [1.18.x, oldstable, stable]
platform: [ubuntu-22.04, ubuntu-24.04, windows-2022, windows-2025, macos-15, macos-26]
runs-on: ${{ matrix.platform }}
timeout-minutes: 10 # guardrails timeout for the whole job
defaults:
run:
shell: bash
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version: ${{ matrix.go-version }}
# Disable caching as we don't have top-level go.sum needed for
# the cache key, and specifying multiple go.sums is not trivial
# (see https://github.com/moby/sys/pull/160 for details).
cache: false
- name: Install golangci-lint
uses: golangci/golangci-lint-action@v9
with:
version: v2.10
# We don't need to run golangci-lint here yet, but
# there's no way to avoid it, so run it on one module.
working-directory: ./mountinfo
- name: Set PACKAGES env
if: ${{ matrix.go-version == '1.18.x' }}
run: |
# Check if the module supports this version of Go.
go_version="$(go env GOVERSION)"
go_version="${go_version#go}"
packages=""
for p in */; do
[ -f "$p/go.mod" ] || continue
if ! (cd "$p" && go list -m -f "{{if gt .GoVersion \"$go_version\"}}ko{{end}}" | grep -q ko); then
packages+="${p%/} "
else
echo "::notice::SKIP: github.com/moby/sys/${p%/} requires a more recent version of Go"
fi
done
echo "PACKAGES=${packages}" >> "$GITHUB_ENV"
- name: go mod tidy
run: |
make foreach CMD="go mod tidy"
git diff --exit-code
- name: go fix
run: |
make foreach CMD="go fix"
git diff --exit-code
- name: Lint
run: make lint
- name: Cross build
if: ${{ runner.os == 'Linux' }}
run: make cross
- name: Test
run: |
uname -a
make test
- name: Send to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }} # used to upload coverage reports: https://github.com/moby/buildkit/pull/4660#issue-2142122533
codespell:
runs-on: ubuntu-24.04
timeout-minutes: 10 # guardrails timeout for the whole job
steps:
- uses: actions/checkout@v6
- run: pip install --break-system-packages codespell==v2.3.0
- run: codespell