mirror of
https://github.com/rwinkhart/peercred-mini.git
synced 2026-08-28 04:46:43 -04:00
Add GitHub action for CI testing
Run tests on the currently supported Go versions on Linux and macOS. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
This commit is contained in:
committed by
Brad Fitzpatrick
parent
21a9ce5438
commit
738f593fd1
@@ -0,0 +1,33 @@
|
||||
name: Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- '*'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
go-version: [1.15, 1.16]
|
||||
platform: [ubuntu-latest, macos-latest]
|
||||
runs-on: ${{ matrix.platform }}
|
||||
|
||||
steps:
|
||||
- name: Install Go
|
||||
uses: actions/setup-go@v2
|
||||
with:
|
||||
go-version: ${{ matrix.go-version }}
|
||||
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Check formatting
|
||||
if: matrix.go-version == '1.16' && matrix.platform == 'ubuntu-latest'
|
||||
run: diff -u <(echo -n) <(go fmt $(go list ./...))
|
||||
|
||||
- name: Run unit tests
|
||||
run: go test -v ./...
|
||||
Reference in New Issue
Block a user