switch from travis to GitHub actions

This commit is contained in:
Michael Stapelberg 2020-12-30 15:21:48 +01:00
parent c25e4f69b4
commit 715e31cb3c
2 changed files with 33 additions and 18 deletions

33
.github/workflows/push.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Push
on:
push:
branches: [ master ]
jobs:
build:
name: CI
runs-on: ubuntu-latest
steps:
- name: Set up Go 1.x
uses: actions/setup-go@v2
with:
# Run on the latest minor release of Go 1.15:
go-version: ^1.15
id: go
- name: Check out code into the Go module directory
uses: actions/checkout@v2
- name: Ensure all files were formatted as per gofmt
run: |
[ "$(gofmt -l $(find . -name '*.go') 2>&1)" = "" ]
- name: Run tests
run: |
go vet .
go test ./...
go test -c github.com/google/nftables
sudo ./nftables.test -test.v -run_system_tests

View File

@ -1,18 +0,0 @@
# Use the (faster) container-based infrastructure, see also
# http://docs.travis-ci.com/user/workers/container-based-infrastructure/
sudo: true
dist: trusty
language: go
go:
- "1.13"
script:
# Check whether files are syntactically correct.
- "gofmt -l $(find . -name '*.go' | tr '\\n' ' ') >/dev/null"
# Check whether files were not gofmt'ed.
- "gosrc=$(find . -name '*.go' | tr '\\n' ' '); [ $(gofmt -l $gosrc 2>&- | wc -l) -eq 0 ] || (echo 'gofmt was not run on these files:'; gofmt -l $gosrc 2>&-; false)"
- go vet .
- go test ./...
- go test -c github.com/google/nftables
- sudo ./nftables.test -test.v -run_system_tests