|
|
|
|
@ -19,7 +19,7 @@ jobs:
|
|
|
|
|
# benchmarks. At the end do a quick check to ensure the tests to not leave
|
|
|
|
|
# files in the tree.
|
|
|
|
|
test:
|
|
|
|
|
name: "test: go${{matrix.gover}}.x/${{matrix.os}}"
|
|
|
|
|
name: "test: ${{matrix.os}}"
|
|
|
|
|
runs-on: "${{matrix.os}}"
|
|
|
|
|
continue-on-error: true
|
|
|
|
|
defaults:
|
|
|
|
|
@ -29,8 +29,6 @@ jobs:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
|
# Do not forget to bump every 6 months!
|
|
|
|
|
gover: ["1.19"]
|
|
|
|
|
env:
|
|
|
|
|
PYTHONDONTWRITEBYTECODE: x
|
|
|
|
|
steps:
|
|
|
|
|
@ -40,10 +38,9 @@ jobs:
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
with:
|
|
|
|
|
fetch-depth: 2
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
|
with:
|
|
|
|
|
go-version: "~${{matrix.gover}}.0"
|
|
|
|
|
cache: true
|
|
|
|
|
go-version-file: go.mod
|
|
|
|
|
- name: 'go install necessary tools'
|
|
|
|
|
if: always()
|
|
|
|
|
run: |
|
|
|
|
|
@ -53,6 +50,7 @@ jobs:
|
|
|
|
|
run: go test -timeout=120s -covermode=count -coverprofile coverage.txt -bench=. -benchtime=1x ./...
|
|
|
|
|
# Don't send code coverage if anything failed to reduce spam.
|
|
|
|
|
- uses: codecov/codecov-action@v2
|
|
|
|
|
timeout-minutes: 1
|
|
|
|
|
- name: 'Cleanup'
|
|
|
|
|
if: always()
|
|
|
|
|
run: rm coverage.txt
|
|
|
|
|
@ -87,7 +85,7 @@ jobs:
|
|
|
|
|
# to cut on runtime, at the cost of latency. I dislike waiting for results
|
|
|
|
|
# so I prefer to run them in parallel.
|
|
|
|
|
lint:
|
|
|
|
|
name: "lint: go${{matrix.gover}}.x/${{matrix.os}}"
|
|
|
|
|
name: "lint: ${{matrix.os}}"
|
|
|
|
|
runs-on: "${{matrix.os}}"
|
|
|
|
|
continue-on-error: true
|
|
|
|
|
defaults:
|
|
|
|
|
@ -100,8 +98,6 @@ jobs:
|
|
|
|
|
# OS-specific code benefits from explicitly linting on macOS and
|
|
|
|
|
# Windows.
|
|
|
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
|
# Do not forget to bump every 6 months!
|
|
|
|
|
gover: ["1.19"]
|
|
|
|
|
env:
|
|
|
|
|
PYTHONDONTWRITEBYTECODE: x
|
|
|
|
|
steps:
|
|
|
|
|
@ -109,10 +105,9 @@ jobs:
|
|
|
|
|
if: matrix.os == 'windows-latest'
|
|
|
|
|
run: git config --global core.autocrlf false
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
|
with:
|
|
|
|
|
go-version: "~${{matrix.gover}}.0"
|
|
|
|
|
cache: true
|
|
|
|
|
go-version-file: go.mod
|
|
|
|
|
- name: "Debug"
|
|
|
|
|
run: |
|
|
|
|
|
echo HOME = $HOME
|
|
|
|
|
@ -227,7 +222,7 @@ jobs:
|
|
|
|
|
- name: "Check: go mod tidy doesn't modify files"
|
|
|
|
|
if: always()
|
|
|
|
|
run: |
|
|
|
|
|
go mod tidy -compat=1.17
|
|
|
|
|
go mod tidy
|
|
|
|
|
TOUCHED=$(git status --porcelain --ignored)
|
|
|
|
|
if ! test -z "$TOUCHED"; then
|
|
|
|
|
echo "go mod tidy was not clean, please update:"
|
|
|
|
|
@ -276,23 +271,20 @@ jobs:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
codeql:
|
|
|
|
|
name: "codeql: go${{matrix.gover}}.x/${{matrix.os}}"
|
|
|
|
|
name: "codeql: ${{matrix.os}}"
|
|
|
|
|
runs-on: "${{matrix.os}}"
|
|
|
|
|
continue-on-error: true
|
|
|
|
|
strategy:
|
|
|
|
|
fail-fast: false
|
|
|
|
|
matrix:
|
|
|
|
|
os: [ubuntu-latest]
|
|
|
|
|
# Do not forget to bump every 6 months!
|
|
|
|
|
gover: ["1.19"]
|
|
|
|
|
permissions:
|
|
|
|
|
security-events: write
|
|
|
|
|
steps:
|
|
|
|
|
- uses: actions/checkout@v3
|
|
|
|
|
- uses: actions/setup-go@v3
|
|
|
|
|
- uses: actions/setup-go@v4
|
|
|
|
|
with:
|
|
|
|
|
go-version: "~${{matrix.gover}}.0"
|
|
|
|
|
cache: true
|
|
|
|
|
go-version-file: go.mod
|
|
|
|
|
- name: Initialize CodeQL
|
|
|
|
|
uses: github/codeql-action/init@v2
|
|
|
|
|
with:
|
|
|
|
|
|