forked from quic-go/quic-go
Bumps [actions/checkout](https://github.com/actions/checkout) from 4 to 5. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
71 lines
2.6 KiB
YAML
71 lines
2.6 KiB
YAML
on: [push, pull_request]
|
|
|
|
|
|
jobs:
|
|
unit:
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
os: [ "ubuntu", "windows", "macos" ]
|
|
go: [ "1.24.x", "1.25.x" ]
|
|
runs-on: ${{ fromJSON(vars[format('UNIT_RUNNER_{0}', matrix.os)] || format('"{0}-latest"', matrix.os)) }}
|
|
name: Unit tests (${{ matrix.os}}, Go ${{ matrix.go }})
|
|
timeout-minutes: 30
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v5
|
|
with:
|
|
go-version: ${{ matrix.go }}
|
|
- run: go version
|
|
- name: Install go-junit-report
|
|
run: go install github.com/jstemmer/go-junit-report/v2@v2.1.0
|
|
- name: Remove integrationtests
|
|
shell: bash
|
|
run: rm -rf integrationtests
|
|
- name: Run tests
|
|
env:
|
|
TIMESCALE_FACTOR: 10
|
|
run: go test -v -shuffle on -cover -coverprofile coverage.txt ./... 2>&1 | go-junit-report -set-exit-code -iocopy -out report.xml
|
|
- name: Run tests as root
|
|
if: ${{ matrix.os == 'ubuntu' }}
|
|
env:
|
|
TIMESCALE_FACTOR: 10
|
|
FILE: sys_conn_helper_linux_test.go
|
|
run: |
|
|
test -f $FILE # make sure the file actually exists
|
|
TEST_NAMES=$(grep '^func Test' "$FILE" | sed 's/^func \([A-Za-z0-9_]*\)(.*/\1/' | tr '\n' '|')
|
|
go test -c -cover -tags root -o quic-go.test .
|
|
sudo ./quic-go.test -test.v -test.run "${TEST_NAMES%|}" -test.coverprofile coverage-root.txt 2>&1 | go-junit-report -set-exit-code -iocopy -package-name github.com/quic-go/quic-go -out report_root.xml
|
|
rm quic-go.test
|
|
- name: Run tests (32 bit)
|
|
if: ${{ matrix.os != 'macos' }} # can't run 32 bit tests on macOS
|
|
env:
|
|
TIMESCALE_FACTOR: 10
|
|
GOARCH: 386
|
|
run: go test -v -shuffle on ./...
|
|
- name: Run tests with race detector
|
|
if: ${{ matrix.os == 'ubuntu' }} # speed things up. Windows and OSX VMs are slow
|
|
env:
|
|
TIMESCALE_FACTOR: 20
|
|
run: go test -v -shuffle on ./...
|
|
- name: Run benchmark tests
|
|
run: go test -v -run=^$ -benchtime 0.5s -bench=. ./...
|
|
- name: Upload coverage to Codecov
|
|
if: ${{ !cancelled() }}
|
|
uses: codecov/codecov-action@v5
|
|
env:
|
|
OS: ${{ matrix.os }}
|
|
GO: ${{ matrix.go }}
|
|
with:
|
|
files: coverage.txt,coverage-root.txt
|
|
env_vars: OS,GO
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
- name: Upload report to Codecov
|
|
if: ${{ !cancelled() }}
|
|
uses: codecov/test-results-action@v1
|
|
with:
|
|
name: Unit tests
|
|
files: report.xml,report_root.xml
|
|
env_vars: OS,GO
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|