mirror of
https://github.com/willnorris/imageproxy.git
synced 2025-01-20 22:53:00 -05:00
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
This commit is contained in:
parent
176e818df9
commit
c2dd079584
1 changed files with 8 additions and 29 deletions
37
.github/workflows/tests.yml
vendored
37
.github/workflows/tests.yml
vendored
|
@ -8,55 +8,34 @@ jobs:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
go-version: [1.12.x, 1.13.x]
|
go-version: [1.12.x, 1.13.x]
|
||||||
platform: [ubuntu-latest]
|
platform: [ubuntu-latest, windows-latest]
|
||||||
runs-on: ${{ matrix.platform }}
|
runs-on: ${{ matrix.platform }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/setup-go@v1
|
- uses: actions/setup-go@v1
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
go-version: ${{ matrix.go-version }}
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- name: Cache go modules
|
- name: Cache go modules
|
||||||
uses: actions/cache@preview
|
uses: actions/cache@v1.1.0
|
||||||
with:
|
with:
|
||||||
path: ~/go/pkg/mod
|
path: ~/go/pkg/mod
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
|
key: ${{ runner.os }}-go-${{ hashFiles('go.sum') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-go-
|
${{ runner.os }}-go-
|
||||||
|
|
||||||
- name: Run go fmt
|
- name: Run go fmt
|
||||||
|
if: runner.os != 'Windows'
|
||||||
run: diff -u <(echo -n) <(gofmt -d -s .)
|
run: diff -u <(echo -n) <(gofmt -d -s .)
|
||||||
|
|
||||||
- name: Run go vet
|
- name: Run go vet
|
||||||
run: go vet ./...
|
run: go vet ./...
|
||||||
|
|
||||||
- name: Run go test
|
- name: Run go test
|
||||||
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
|
run: go test -v -race -coverprofile coverage.txt -covermode atomic ./...
|
||||||
|
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
env:
|
uses: codecov/codecov-action@v1
|
||||||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|
|
||||||
run: bash <(curl -s https://codecov.io/bash)
|
|
||||||
|
|
||||||
# On Windows, just run the local tests. Don't bother with checking gofmt, go
|
|
||||||
# vet, or uploading results to Codecov
|
|
||||||
test-windows:
|
|
||||||
strategy:
|
|
||||||
matrix:
|
|
||||||
go-version: [1.12.x, 1.13.x]
|
|
||||||
platform: [windows-latest]
|
|
||||||
runs-on: ${{ matrix.platform }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/setup-go@v1
|
|
||||||
with:
|
with:
|
||||||
go-version: ${{ matrix.go-version }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
- uses: actions/checkout@v1
|
|
||||||
- name: Cache go modules
|
|
||||||
uses: actions/cache@preview
|
|
||||||
with:
|
|
||||||
path: ~/go/pkg/mod
|
|
||||||
key: ${{ runner.os }}-go-${{ hashFiles('**\go.sum') }}
|
|
||||||
restore-keys: |
|
|
||||||
${{ runner.os }}-go-
|
|
||||||
- run: go test ./...
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue