-
Notifications
You must be signed in to change notification settings - Fork 37
75 lines (71 loc) · 1.82 KB
/
tests.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
name: Tests
on:
push:
branches:
- main
pull_request:
jobs:
build:
runs-on: ubuntu-22.04
name: Build
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.19.x'
- uses: actions/checkout@v4
- name: Build all
run: |
make
ls -al ./out/buildg
if ldd ./out/buildg ; then echo "buildg must be static binary" ; exit 1 ; fi
test:
runs-on: ubuntu-22.04
name: Test
strategy:
fail-fast: false
matrix:
mode: ["root", "rootless"]
steps:
- uses: actions/setup-go@v5
with:
go-version: '1.19.x'
- uses: actions/checkout@v4
- name: Build and install
run: |
DOCKER_BUILDKIT=1 docker build --output type=tar,dest=${GITHUB_WORKSPACE}/buildg-full.tar --target out-full --platform amd64 .
sudo tar -C /usr/local/ -xvf ${GITHUB_WORKSPACE}/buildg-full.tar
- name: Test
run: |
if [ "${{ matrix.mode }}" == "root" ] ; then
sudo go test -v ./...
elif [ "${{ matrix.mode }}" == "rootless" ] ; then
mkdir -p ${GITHUB_WORKSPACE}/tmp
TEST_BUILDG_TMP_DIR=${GITHUB_WORKSPACE}/tmp go test -v ./...
else
echo "unknown mode ${{ matrix.mode }}"
exit 1
fi
linter:
runs-on: ubuntu-22.04
name: Linter
steps:
- uses: actions/checkout@v4
- name: golangci-lint
uses: golangci/golangci-lint-action@v4
with:
version: v1.52
args: --verbose
project:
name: Project Checks
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-go@v5
with:
go-version: 1.19.x
- uses: actions/checkout@v4
with:
fetch-depth: 100
- name: "Check DCO sign"
run: |
go install github.com/vbatts/[email protected]
git-validation -v -run DCO