-
Notifications
You must be signed in to change notification settings - Fork 9
121 lines (105 loc) · 2.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
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
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
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
go-version: ${{ matrix.go }}
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Install dependencies
run: |
sudo apt-get install -y libacl1-dev
GO111MODULE=off go get golang.org/x/lint/golint
- 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
container:
image: ${{ github.repository }}:builder
outputs:
deb: ${{ steps.build.outputs.deb }}
rpm: ${{ steps.build.outputs.rpm }}
sha256sum: ${{ steps.build.outputs.sha256sum }}
md5sum: ${{ steps.build.outputs.md5sum }}
steps:
- uses: actions/checkout@v2
name: Checkout
- 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@v2
with:
name: packages
path: artifact
docker:
name: Build docker images
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
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@v2
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