Skip to content

Commit

Permalink
switch from travis to GitHub actions
Browse files Browse the repository at this point in the history
  • Loading branch information
stapelberg committed Jun 16, 2020
1 parent b090fa2 commit 9c7e626
Show file tree
Hide file tree
Showing 2 changed files with 78 additions and 28 deletions.
78 changes: 78 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: GitHub Actions CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:

build:
name: build
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.14:
go-version: ^1.14
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') >/dev/null
- name: Go Vet
run: |
go vet
- name: Build
run: |
go build -v ./cmd/...
test:
name: test
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.14:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Test
run: |
go test -v -race ./internal/...
integrationtest:
name: integrationtest
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.14:
go-version: ^1.14
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Build Docker container with the tools our tests require
run: |
docker build --pull --no-cache --rm -t=router7 -f travis/Dockerfile .
- name: Run tests in Docker container
run: |
exit=0; for pkg in $(go list ./integration/...); do go test -c $pkg && docker run --privileged --net=host -v $PWD:/usr/src:ro router7 /bin/sh -c "./$(basename $pkg).test -test.v" || exit=1; done; [ $exit = 0 ]
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

0 comments on commit 9c7e626

Please sign in to comment.