Skip to content

Commit 874138c

Browse files
authored
Merge pull request #105 from WireGuard/mdl-actions
github: initial GitHub actions workflows
2 parents 8c2ce5d + 5dd4bb4 commit 874138c

File tree

6 files changed

+109
-41
lines changed

6 files changed

+109
-41
lines changed

.builds/linux.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

.cibuild.sh

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ set -x
44

55
# !! This script is meant for use in CI build use only !!
66

7-
BINDIR=/home/build/go/bin
8-
97
KERNEL=$(uname -s)
108

119
# Use doas in place of sudo for OpenBSD.
@@ -15,13 +13,6 @@ if [ "${KERNEL}" == "OpenBSD" ]; then
1513
fi
1614

1715
if [ "${KERNEL}" == "Linux" ]; then
18-
# Set up the WireGuard kernel module on Linux.
19-
sudo apt --allow-unauthenticated -y update
20-
sudo apt -y install software-properties-common
21-
sudo add-apt-repository -y ppa:wireguard/wireguard
22-
sudo apt --allow-unauthenticated -y update
23-
sudo apt --allow-unauthenticated -y install linux-headers-$(uname -r) wireguard-dkms wireguard-tools
24-
2516
# Configure a WireGuard interface.
2617
sudo ip link add wg0 type wireguard
2718
sudo ip link set up wg0
@@ -39,7 +30,6 @@ else
3930
go build -o wireguard-go
4031
fi
4132

42-
mkdir -p ${BINDIR}
43-
${SUDO} mv ./wireguard-go ${BINDIR}/wireguard-go
33+
${SUDO} mv ./wireguard-go /usr/local/bin/wireguard-go
4434
cd ..
4535
${SUDO} rm -rf ./wireguard-go
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Linux Integration Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
go-version: [1.16]
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
id: go
24+
25+
- name: Check out code into the Go module directory
26+
uses: actions/checkout@v2
27+
28+
- name: Set up integration test WireGuard interfaces
29+
run: ./.cibuild.sh
30+
31+
- name: Start wireguard-go userspace device
32+
run: sudo wireguard-go wguser0
33+
34+
- name: Build integration test binary
35+
run: go test -c -race .
36+
37+
- name: Run integration tests
38+
run: sudo WGCTRL_INTEGRATION=yesreallydoit ./wgctrl.test -test.v -test.run TestIntegration

.github/workflows/linux-test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Linux Test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
go-version: [1.16]
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
id: go
24+
25+
- name: Check out code into the Go module directory
26+
uses: actions/checkout@v2
27+
28+
- name: Run tests
29+
run: go test -race ./...

.github/workflows/static-analysis.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Static Analysis
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- '*'
10+
11+
jobs:
12+
build:
13+
strategy:
14+
matrix:
15+
go-version: [1.16]
16+
runs-on: ubuntu-latest
17+
18+
steps:
19+
- name: Set up Go
20+
uses: actions/setup-go@v2
21+
with:
22+
go-version: ${{ matrix.go-version }}
23+
id: go
24+
25+
- name: Check out code into the Go module directory
26+
uses: actions/checkout@v2
27+
28+
- name: Download staticcheck
29+
run: go get honnef.co/go/tools/cmd/staticcheck
30+
31+
- name: Print staticcheck version
32+
run: go run honnef.co/go/tools/cmd/staticcheck -version
33+
34+
- name: Run staticcheck
35+
run: go run honnef.co/go/tools/cmd/staticcheck -- ./...
36+
37+
- name: Run go vet
38+
run: go vet ./...

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
# wgctrl [![builds.sr.ht status](https://builds.sr.ht/~mdlayher/wgctrl-go.svg)](https://builds.sr.ht/~mdlayher/wgctrl-go?) [![GoDoc](https://godoc.org/golang.zx2c4.com/wireguard/wgctrl?status.svg)](https://godoc.org/golang.zx2c4.com/wireguard/wgctrl) [![Go Report Card](https://goreportcard.com/badge/golang.zx2c4.com/wireguard/wgctrl)](https://goreportcard.com/report/golang.zx2c4.com/wireguard/wgctrl)
1+
# wgctrl [![Test Status](https://golang.zx2c4.com/wireguard/wgctrl/workflows/Linux%20Test/badge.svg)](https://github.com/WireGuard/wgctrl-go/actions) [![Go Reference](https://pkg.go.dev/badge/golang.zx2c4.com/wireguard/wgctrl.svg)](https://pkg.go.dev/golang.zx2c4.com/wireguard/wgctrl) [![Go Report Card](https://goreportcard.com/badge/golang.zx2c4.com/wireguard/wgctrl)](https://goreportcard.com/report/golang.zx2c4.com/wireguard/wgctrl)
2+
3+
[![Test Status](https://golang.zx2c4.com/wireguard/wgctrl/workflows/Linux%20Test/badge.svg)](https://golang.zx2c4.com/wireguard/wgctrl/actions) [![Go Reference](https://pkg.go.dev/badge/golang.zx2c4.com/wireguard/wgctrl.svg)](https://pkg.go.dev/golang.zx2c4.com/wireguard/wgctrl)
24

35
Package `wgctrl` enables control of WireGuard devices on multiple platforms.
46

0 commit comments

Comments
 (0)