refactor: use context.AfterFunc
to track timeouts instead of gorout…
#668
This file contains hidden or 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
name: ci | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- run: make fmt | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- run: go version | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- run: make lint | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Disable AppArmor | |
if: runner.os == 'Linux' | |
run: | | |
# Disable AppArmor for Ubuntu 23.10+. | |
# https://chromium.googlesource.com/chromium/src/+/main/docs/security/apparmor-userns-restrictions.md | |
echo 0 | sudo tee /proc/sys/kernel/apparmor_restrict_unprivileged_userns | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- run: make test | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: coverage.html | |
path: ./ci/out/coverage.html | |
bench: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version-file: ./go.mod | |
- run: make bench |