forked from fragglet/ipxbox
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (59 loc) · 1.58 KB
/
go.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
name: Continuous Integration
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install pcap
run: |
sudo apt update
sudo apt install libpcap-dev
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Build
run: go build -v ipxbox.go
- name: Test
run: |
go test network/pipe/*.go
go test network/filter/*.go
go test ipx/*.go
crosscompile:
strategy:
matrix:
goarch: [386, amd64, arm64]
goos: [darwin, freebsd, linux, windows]
exclude:
- goarch: 386
goos: darwin
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Build
run: |
mkdir artifacts
cd artifacts
go build -tags nopcap -v ../ipxbox.go
go build -tags nopcap -v ../standalone/ipxbox_uplink.go
env:
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}
# Github packages artifacts in .zip files which don't preserve
# permissions, so we must make an inner tar. Sigh.
- name: Tar artifacts
run: |
mv artifacts artifacts2
mkdir artifacts
tar -C artifacts2 -czf artifacts/contents.tar.gz .
if: ${{ matrix.goos != 'windows' }}
- name: Upload build
uses: actions/upload-artifact@v1
with:
path: "artifacts"
name: ipxbox_${{ matrix.goos }}_${{ matrix.goarch }}