-
Notifications
You must be signed in to change notification settings - Fork 5
98 lines (80 loc) · 2.29 KB
/
ci.yml
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: [ main ]
pull_request:
branches: [ main ]
env:
# Go version we currently use to build containerd across all CI.
# Note: don't forget to update `Binaries` step, as it contains the matrix of all supported Go versions.
GO_VERSION: "1.22.8"
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
#
# golangci-lint
#
linters:
permissions:
contents: read # for actions/checkout to fetch code
pull-requests: read # for golangci/golangci-lint-action to fetch pull requests
name: Linters
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false # see actions/setup-go#368
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v6
with:
version: v1.61.0
skip-cache: true
args: --timeout=5m
#
# Project checks
#
project:
name: Project Checks
if: github.repository == 'containerd/errdefs'
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
cache: false # see actions/setup-go#368
- uses: actions/checkout@v4
with:
path: src/github.com/containerd/errdefs
fetch-depth: 25
- uses: containerd/project-checks@v1.1.0
with:
working-directory: src/github.com/containerd/errdefs
repo-access-token: ${{ secrets.GITHUB_TOKEN }}
tests:
name: Tests
runs-on: ${{ matrix.os }}
timeout-minutes: 5
strategy:
matrix:
os: [ubuntu-22.04, macos-13, windows-2022]
steps:
- uses: actions/checkout@v4
with:
path: src/github.com/containerd/errdefs
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- run: |
go test -v -race
working-directory: src/github.com/containerd/errdefs