2019-12-06 11:22:07 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2021-09-21 16:15:31 +00:00
|
|
|
test:
|
|
|
|
name: Test
|
2020-09-05 21:53:06 +00:00
|
|
|
runs-on: ${{ matrix.os }}
|
2019-12-06 11:22:07 +00:00
|
|
|
strategy:
|
2021-09-21 09:25:18 +00:00
|
|
|
# Fail fast is disabled because there are Go version specific features and tests
|
|
|
|
# that should be able to fail independently.
|
|
|
|
fail-fast: false
|
2019-12-06 11:22:07 +00:00
|
|
|
matrix:
|
2021-09-21 09:26:55 +00:00
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
2022-04-13 11:09:48 +00:00
|
|
|
go: ['1.14', '1.15', '1.16', '1.17', '1.18']
|
2022-01-01 17:33:39 +00:00
|
|
|
tags: ['', 'viper_yaml3', 'viper_toml2']
|
2019-12-06 11:22:07 +00:00
|
|
|
env:
|
|
|
|
GOFLAGS: -mod=readonly
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
2022-04-08 17:14:08 +00:00
|
|
|
uses: actions/setup-go@v3
|
2019-12-06 11:22:07 +00:00
|
|
|
with:
|
|
|
|
go-version: ${{ matrix.go }}
|
|
|
|
|
|
|
|
- name: Checkout code
|
2022-03-02 17:18:31 +00:00
|
|
|
uses: actions/checkout@v3
|
2019-12-06 11:22:07 +00:00
|
|
|
|
2021-09-21 16:15:31 +00:00
|
|
|
- name: Test
|
2022-01-01 15:48:46 +00:00
|
|
|
run: go test -race -tags '${{ matrix.tags }}' -v ./...
|
2021-12-28 08:37:48 +00:00
|
|
|
if: runner.os != 'Windows'
|
|
|
|
|
|
|
|
- name: Test (without race detector)
|
2022-01-01 15:48:46 +00:00
|
|
|
run: go test -tags '${{ matrix.tags }}' -v ./...
|
2021-12-28 08:37:48 +00:00
|
|
|
if: runner.os == 'Windows'
|
2021-09-21 16:15:31 +00:00
|
|
|
|
|
|
|
lint:
|
|
|
|
name: Lint
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
env:
|
|
|
|
GOFLAGS: -mod=readonly
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Set up Go
|
2022-04-08 17:14:08 +00:00
|
|
|
uses: actions/setup-go@v3
|
2021-09-21 16:15:31 +00:00
|
|
|
with:
|
|
|
|
go-version: 1.17
|
|
|
|
|
|
|
|
- name: Checkout code
|
2022-03-02 17:18:31 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-09-21 16:15:31 +00:00
|
|
|
|
2020-05-09 09:42:39 +00:00
|
|
|
- name: Lint
|
2022-04-13 11:09:48 +00:00
|
|
|
uses: golangci/golangci-lint-action@v3
|
2021-09-21 09:34:22 +00:00
|
|
|
with:
|
2022-04-13 11:09:48 +00:00
|
|
|
version: v1.45.2
|