-
Notifications
You must be signed in to change notification settings - Fork 9
132 lines (113 loc) · 3.13 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
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
132
name: Tests
on:
push:
branches: [master]
pull_request:
branches: [master]
jobs:
tests:
name: Test code
runs-on: ubuntu-latest
strategy:
matrix:
go:
- ^1.21
- ^1.22
- ^1.23
- ^1
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get install -y libacl1-dev
go install golang.org/x/lint/golint@latest
go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
- name: Test
run: |
make test
golint ./...
- name: Build and run version
run: |
make VERSION=testing-version clean build
./build/grafsy -v
CGO_ENABLED=0 make GO_FLAGS='-tags noacl' VERSION=testing-version clean build
./build/grafsy -v
build:
name: Build packages
runs-on: ubuntu-latest
outputs:
deb: ${{ steps.build.outputs.deb }}
rpm: ${{ steps.build.outputs.rpm }}
sha256sum: ${{ steps.build.outputs.sha256sum }}
md5sum: ${{ steps.build.outputs.md5sum }}
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v5
with:
go-version: ^1
- name: Check out code into the Go module directory
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get install -y libacl1-dev
go install github.com/goreleaser/nfpm/v2/cmd/[email protected]
- name: Build packages
id: build
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git tag -m 'Test build' v0.0.0.1
make packages
make github_artifact
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: packages
path: artifact
docker:
name: Build docker images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- name: Build docker images
run: |
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
git tag -m 'Test build' v0.0.0.1
make docker
install:
needs: build
name: Install packages
runs-on: ubuntu-latest
container:
image: ${{ matrix.os }}
strategy:
matrix:
os:
- debian:11
- debian:12
- debian:13
- ubuntu:20.04
- ubuntu:22.04
- ubuntu:24.04
- centos:8
- centos:9
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: packages
- name: Test deb
if: ${{ contains(matrix.os, 'debian') || contains(matrix.os, 'ubuntu') }}
run: |
apt-get install libacl1; dpkg -i grafsy_0.0.0.1*deb
- name: Test rpm
if: ${{ contains(matrix.os, 'centos') }}
run: |
rpm -i grafsy-0.0.0.1*rpm