2020-06-19 09:19:37 -04:00
|
|
|
name: Test
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
2020-11-23 07:51:58 -05:00
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- v*
|
2021-05-04 15:27:14 -04:00
|
|
|
- dev-*
|
2020-08-25 02:46:04 -04:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2020-09-09 01:56:17 -04:00
|
|
|
- "go.mod"
|
|
|
|
- "go.sum"
|
2021-05-10 18:26:39 -04:00
|
|
|
- ".github/workflows/test.yml"
|
2020-06-19 09:19:37 -04:00
|
|
|
pull_request:
|
2020-08-30 13:10:28 -04:00
|
|
|
types: [opened, synchronize, reopened]
|
2020-08-24 12:04:55 -04:00
|
|
|
paths:
|
|
|
|
- "**/*.go"
|
2020-09-09 01:56:17 -04:00
|
|
|
- "go.mod"
|
|
|
|
- "go.sum"
|
2021-05-10 18:26:39 -04:00
|
|
|
- ".github/workflows/test.yml"
|
2020-06-19 09:19:37 -04:00
|
|
|
|
|
|
|
jobs:
|
2020-08-24 04:09:51 -04:00
|
|
|
test:
|
2020-06-19 09:19:37 -04:00
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
strategy:
|
2020-11-15 10:39:23 -05:00
|
|
|
fail-fast: false
|
2020-06-19 09:19:37 -04:00
|
|
|
matrix:
|
|
|
|
os: [windows-latest, ubuntu-latest, macos-latest]
|
|
|
|
steps:
|
|
|
|
- name: Set up Go 1.x
|
2022-04-09 05:41:11 -04:00
|
|
|
uses: actions/setup-go@v3
|
2020-06-19 09:19:37 -04:00
|
|
|
with:
|
2022-08-19 07:11:54 -04:00
|
|
|
go-version: ^1.19
|
2020-06-19 09:19:37 -04:00
|
|
|
|
2020-08-30 13:10:28 -04:00
|
|
|
- name: Checkout codebase
|
2022-03-02 00:10:12 -05:00
|
|
|
uses: actions/checkout@v3
|
2021-06-12 22:13:29 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2020-06-19 09:19:37 -04:00
|
|
|
|
2021-08-21 02:45:38 -04:00
|
|
|
- name: Check Go modules
|
|
|
|
run: |
|
|
|
|
go mod tidy
|
|
|
|
git diff --exit-code go.mod go.sum
|
|
|
|
go mod verify
|
|
|
|
|
2020-06-19 09:19:37 -04:00
|
|
|
- name: Test
|
2021-06-12 22:13:29 -04:00
|
|
|
run: |
|
|
|
|
export PATH=$(go env GOPATH)/bin:${PATH}
|
|
|
|
go install -v github.com/ory/go-acc@latest
|
|
|
|
go-acc --covermode=atomic -o=coverage.txt ./...
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
- name: Upload codecov
|
|
|
|
run: bash <(curl -s https://codecov.io/bash)
|
|
|
|
shell: bash
|