-
-
Notifications
You must be signed in to change notification settings - Fork 471
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(project): Add GitHub Actions testing workflow
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
1 parent
1fc10e0
commit 4f03fa8
Showing
1 changed file
with
50 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |