Skip to content

GitHub Workflow: tests #203

GitHub Workflow: tests

GitHub Workflow: tests #203

Workflow file for this run

name: p9
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:
build_and_test:
name: Build
strategy:
matrix:
go-version: ['1.21.x']
platform: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v4
with:
go-version: ${{ matrix.go-version }}
- name: Build
run: go build -v ./...
- name: Test
run: |
go test -v -covermode=atomic -coverpkg=./... \
-coverprofile=coverage.txt ./...
- name: Race
run: go test -race -timeout 15m -v ./...
- uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: '0ecf29bb-15fb-46f2-8c7d-0fb610d79f71'
with:
flags: ${{ matrix.platform }}-unit
fail_ci_if_error: true
verbose: true
fuzz:
name: Fuzz
runs-on: [ubuntu-latest]
needs: [build]
steps:
- name: Build Fuzzers
id: build
uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
with:
oss-fuzz-project-name: 'p9'
dry-run: false
- name: Run Fuzzers
uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
with:
oss-fuzz-project-name: 'p9'
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
uses: actions/upload-artifact@v1
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
path: ./out/artifacts
vmtest:
runs-on: ubuntu-latest
strategy:
matrix:

Check failure on line 77 in .github/workflows/p9.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/p9.yml

Invalid workflow file

You have an error in your yaml syntax on line 77
go-version: [ '1.21.x' ]
vmarch: [ 'amd64', 'arm', 'arm64' ]
# 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
GOCOVERDIR=$(pwd)/gocov \
VMTEST_GO_PROFILE=vmcoverage.txt runvmtest -- \
go test -v -coverpkg=./... -covermode=atomic \
-coverprofile=coverage.txt ./...
- uses: codecov/codecov-action@v4-beta
env:
CODECOV_TOKEN: '0ecf29bb-15fb-46f2-8c7d-0fb610d79f71'
with:
flags: ubuntu-vm-${{ matrix.vmarch }}
fail_ci_if_error: true
verbose: true
env_vars: GO_VERSION,VMTEST_ARCH