examples/uinit: call generic bin/defaultsh #5
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
name: Tests | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
# Cancel running workflows on new push to a PR. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
go-version: [ '1.21.x', '1.22.x' ] | |
vmarch: [ 'amd64', 'arm', 'arm64' ] | |
pattern: [ 'integration/generic-tests/...', 'integration/gotests/...' ] | |
include: | |
# Only run these with VM arch amd64 for now. | |
- go-version: '1.21.x' | |
vmarch: 'amd64' | |
pattern: 'cmds/...' | |
- go-version: '1.22.x' | |
vmarch: 'amd64' | |
pattern: 'cmds/...' | |
- go-version: '1.21.x' | |
vmarch: 'amd64' | |
pattern: 'pkg/...' | |
extra-arg: '-coverpkg=./pkg/...' | |
- go-version: '1.22.x' | |
vmarch: 'amd64' | |
pattern: 'pkg/...' | |
extra-arg: '-coverpkg=./pkg/...' | |
# Root dir tests | |
- go-version: '1.21.x' | |
vmarch: 'amd64' | |
pattern: '.' | |
- go-version: '1.22.x' | |
vmarch: 'amd64' | |
pattern: '.' | |
# QEMU's -M virt only supports GOARM=5, so add goarm=5 only for | |
# arm configs | |
- vmarch: arm | |
goarm: '5' | |
env: | |
GO_VERSION: ${{ matrix.go-version }} | |
VMTEST_ARCH: ${{ matrix.vmarch }} | |
GOARM: ${{ matrix.goarm }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go ${{ matrix.go-version }} | |
uses: actions/setup-go@v4 | |
with: | |
go-version: ${{ matrix.go-version }} | |
- name: Build runvm tool | |
run: go install github.com/hugelgupf/vmtest/tools/runvmtest@latest | |
- name: Test | |
run: | | |
mkdir gocov | |
VMTEST_GOCOVERDIR=$(pwd)/gocov \ | |
VMTEST_GO_PROFILE=vmcoverage.txt runvmtest -- \ | |
go test -v -covermode=atomic ${{ matrix.extra-arg }} \ | |
-coverprofile=coverage.txt ./${{ matrix.pattern }} | |
- name: Convert GOCOVERDIR coverage data | |
run: go tool covdata textfmt -i=gocov -o vmintcoverage.txt | |
- uses: codecov/codecov-action@v4-beta | |
env: | |
CODECOV_TOKEN: '0ecf29bb-15fb-46f2-8c7d-0fb610d79f71' | |
with: | |
flags: ${{ matrix.pattern}}-${{ matrix.vmarch }} | |
fail_ci_if_error: true | |
verbose: true | |
env_vars: GO_VERSION,VMTEST_ARCH |