Skip to content

Commit

Permalink
feat(project): Add GitHub Actions testing workflow
Browse files Browse the repository at this point in the history
GitHub actions is a workflow engine.
This testing workflow will
- keep everything inside GitHub (one platform)
- reduce dependency to an external service (TravisCI)
- introduce stricter testing (next to unit tests, staticcheck, fmt, vet)
  • Loading branch information
andygrunwald committed May 2, 2020
1 parent 1fc10e0 commit 4f03fa8
Showing 1 changed file with 50 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Tests

on:
push:
branches:
- master
pull_request:

jobs:
test:
name: Test and lint
strategy:
matrix:
go-version: [
1.9.x,
1.10.x,
1.11.x,
1.12.x,
1.13.x,
1.14.x
]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}

steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
go-version: 1.14

# Caching go modules to speed up the run
- uses: actions/cache@v1
with:
path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Run go fmt
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(gofmt -d -s .)

- name: Run go vet
run: make vet

- name: Run staticcheck
run: make staticcheck

- name: Run Unit tests.
run: make test

0 comments on commit 4f03fa8

Please sign in to comment.