Skip to content

Testing

Testing #1253

Workflow file for this run

name: Testing
on:
push:
branches:
- main
pull_request:
schedule:
- cron: "5 1 * * *" # Run nightly
workflow_dispatch:
jobs:
gofmt:
name: go fmt
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Run go fmt
if: runner.os != 'Windows'
run: diff -u <(echo -n) <(gofmt -d -s .)
govet:
name: go vet
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Run go vet
run: make vet
staticcheck:
name: staticcheck
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1.20'
- name: Run staticcheck
uses: dominikh/staticcheck-action@v1.3.1
with:
version: "2023.1.3"
install-go: false
cache-key: staticcheck
unittesting:
name: unit testing (Go ${{ matrix.go }})
runs-on: ubuntu-22.04
strategy:
matrix:
go: [ '1.20', '1.19' ]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
# Checkout the Fuzzing seed and generated corpus
# Classical unit tests execute the fuzzing tests as well,
# but mainly with the pre-existing corpus.
#
# Deactivated right now, because this let the unit tests
# run into an execution timeout.
#
#- uses: actions/checkout@v4
# with:
# repository: andygrunwald/vdf-fuzzing-corpus
# path: testdata/fuzz
- name: Run Unit tests.
run: make test