This repository has been archived by the owner on Oct 21, 2023. It is now read-only.
chore(deps): update actions/setup-python action to v4 #219
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
name: Build | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
lint: | |
name: Lint files | |
runs-on: 'ubuntu-latest' | |
steps: | |
- uses: actions/[email protected] | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.17.x' | |
- uses: actions/[email protected] | |
- uses: actions/cache@v3 | |
with: | |
# In order: | |
# * Module download cache | |
# * Build cache (Linux) | |
# * Build cache (Mac) | |
# * Build cache (Windows) | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
%LocalAppData%\go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- uses: pre-commit/[email protected] | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
fetch-depth: 2 | |
- uses: actions/setup-go@v3 | |
with: | |
go-version: '1.16.x' | |
- name: List | |
run: go list -mod=mod all | |
- name: Run coverage | |
run: | | |
go get -u github.com/ory/go-acc | |
go mod vendor | |
$(go env GOPATH)/bin/go-acc --ignore 'examples' ./... | |
- name: Upload coverage to Codecov | |
run: | | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
./codecov -t ${{ secrets.CODECOV_TOKEN }} | |
test: | |
strategy: | |
matrix: | |
go-version: [1.15.x, 1.16.x, 1.17.x] | |
runs-on: 'ubuntu-latest' | |
steps: | |
- name: Install Go | |
uses: actions/setup-go@v3 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Checkout code | |
uses: actions/[email protected] | |
- uses: actions/cache@v3 | |
with: | |
# In order: | |
# * Module download cache | |
# * Build cache (Linux) | |
# * Build cache (Mac) | |
# * Build cache (Windows) | |
path: | | |
~/go/pkg/mod | |
~/.cache/go-build | |
~/Library/Caches/go-build | |
%LocalAppData%\go-build | |
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go- | |
- name: Test | |
run: go test -v -race |