-
Notifications
You must be signed in to change notification settings - Fork 75
92 lines (81 loc) · 2.44 KB
/
check.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
name: Check
on:
push:
branches:
- main
pull_request:
jobs:
#
# Linter checker
#
linters:
name: Linters
runs-on: ubuntu-22.04
timeout-minutes: 10
strategy:
matrix:
go-version: [1.22.0]
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v4
- uses: golangci/golangci-lint-action@v6
with:
version: v1.59
skip-cache: true
args: --timeout=5m
#
# Project checker
#
# based on https://github.com/containerd/project-checks/blob/main/action.yml
project:
name: Project Checks
runs-on: ubuntu-22.04
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
with:
path: src/github.com/containerd/accelerated-container-image
fetch-depth: 100
- name: set env
shell: bash
run: |
echo "GOPATH=${{ github.workspace }}" >> $GITHUB_ENV
echo "${{ github.workspace }}/bin" >> $GITHUB_PATH
- name: install dependencies
shell: bash
env:
GO111MODULE: on
run: |
echo "::group:: install dependencies"
go install -v github.com/vbatts/git-validation@latest
go install -v github.com/kunalkushwaha/ltag@latest
echo "::endgroup::"
- name: DCO checker
shell: bash
working-directory: src/github.com/containerd/accelerated-container-image
env:
GITHUB_COMMIT_URL: ${{ github.event.pull_request.commits_url }}
DCO_VERBOSITY: "-v"
DCO_RANGE: ""
run: |
echo "::group:: DCO checks"
set -eu -o pipefail
if [ -z "${GITHUB_COMMIT_URL}" ]; then
DCO_RANGE=$(jq -r '.after + "..HEAD"' ${GITHUB_EVENT_PATH})
else
DCO_RANGE=$(curl ${GITHUB_COMMIT_URL} | jq -r '.[0].parents[0].sha + "..HEAD"')
fi
range=
[ ! -z "${DCO_RANGE}" ] && range="-range ${DCO_RANGE}"
git-validation ${DCO_VERBOSITY} ${range} -run DCO,short-subject,dangling-whitespace
echo "::endgroup::"
- name: validate file headers
shell: bash
working-directory: src/github.com/containerd/accelerated-container-image
run: |
set -eu -o pipefail
echo "::group:: file headers"
ltag -t "script/validate/template" --excludes "vendor contrib" --check -v
echo "::endgroup::"