0
Fork 0
mirror of https://github.com/willnorris/imageproxy.git synced 2025-01-06 22:40:34 -05:00
imageproxy/.github/workflows/tests.yml
Will Norris c2dd079584 update github actions config
- combine windows and linux configs into a single matrix, now that
  actions/cache handles file paths properly
- update to latest actions/checkout and codecov actions
2020-01-26 21:16:19 +00:00

41 lines
966 B
YAML

on: [push, pull_request]
name: tests
env:
GO111MODULE: on
jobs:
test:
strategy:
matrix:
go-version: [1.12.x, 1.13.x]
platform: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v1
with:
go-version: ${{ matrix.go-version }}
- uses: actions/checkout@v2
- name: Cache go modules
uses: actions/cache@v1.1.0
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: go vet ./...
- name: Run go test
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./...
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}