mirror of
https://github.com/rwinkhart/peercred-mini.git
synced 2026-08-28 04:46:43 -04:00
Make sure go.mod and go.sum match the current source in the module. Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
40 lines
782 B
YAML
40 lines
782 B
YAML
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: Check Go modules
|
|
if: matrix.go-version == '1.16'
|
|
run: |
|
|
go mod tidy
|
|
git diff --exit-code
|
|
|
|
- name: Run unit tests
|
|
run: go test -v ./...
|