Test #604
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: Test | |
on: | |
push: | |
branches: [ "main" ] | |
paths: | |
- '**.go' | |
- '**.wasm' | |
- '**.wasm.bz2' | |
pull_request: | |
branches: [ "main" ] | |
paths: | |
- '**.go' | |
- '**.wasm' | |
- '**.wasm.bz2' | |
workflow_dispatch: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: { go-version: stable } | |
- name: Git LFS pull | |
uses: ./.github/actions/lfs | |
- name: Format | |
run: gofmt -s -w . && git diff --exit-code | |
if: matrix.os != 'windows-latest' | |
- name: Tidy | |
run: go mod tidy && git diff --exit-code | |
- name: Download | |
run: go mod download | |
- name: Verify | |
run: go mod verify | |
- name: Vet | |
run: go vet ./... | |
- name: Build | |
run: go build -v ./... | |
- name: Test | |
run: go test -v ./... -bench . -benchtime=1x | |
- name: Test no locks | |
run: go test -v -tags sqlite3_nosys ./... | |
if: matrix.os == 'ubuntu-latest' | |
- name: Test BSD locks | |
run: go test -v -tags sqlite3_flock ./... | |
if: matrix.os == 'macos-latest' | |
- name: Test dot locks | |
run: go test -v -tags sqlite3_dotlk ./... | |
if: matrix.os != 'windows-latest' | |
- name: Test GORM | |
shell: bash | |
run: gormlite/test.sh | |
- name: Collect coverage | |
run: go run github.com/dave/courtney@latest | |
if: | | |
github.event_name == 'push' && | |
matrix.os == 'ubuntu-latest' | |
- uses: ncruces/go-coverage-report@v0 | |
with: | |
coverage-file: coverage.out | |
chart: true | |
amend: true | |
if: | | |
github.event_name == 'push' && | |
matrix.os == 'ubuntu-latest' | |
test-bsd: | |
strategy: | |
matrix: | |
os: | |
- name: freebsd | |
version: '14.1' | |
flags: '-test.v' | |
- name: openbsd | |
version: '7.5' | |
flags: '-test.v -test.short' | |
- name: netbsd | |
version: '10.0' | |
flags: '-test.v -test.short' | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Git LFS pull | |
uses: ./.github/actions/lfs | |
- name: Build | |
env: | |
GOOS: ${{ matrix.os.name }} | |
TESTFLAGS: ${{ matrix.os.flags }} | |
run: .github/workflows/build-test.sh | |
- name: Test | |
uses: cross-platform-actions/[email protected] | |
with: | |
operating_system: ${{ matrix.os.name }} | |
version: ${{ matrix.os.version }} | |
shell: bash | |
run: . ./test.sh | |
sync_files: runner-to-vm | |
test-vm: | |
strategy: | |
matrix: | |
os: | |
- name: dragonfly | |
action: 'vmactions/dragonflybsd-vm@v1' | |
flags: '-test.v -test.short' | |
- name: illumos | |
action: 'vmactions/omnios-vm@v1' | |
flags: '-test.v -test.short' | |
- name: solaris | |
action: 'vmactions/solaris-vm@v1' | |
flags: '-test.v -test.short' | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Git LFS pull | |
uses: ./.github/actions/lfs | |
- name: Build | |
env: | |
GOOS: ${{ matrix.os.name }} | |
TESTFLAGS: ${{ matrix.os.flags }} | |
VMACTIONS: ${{ matrix.os.action }} | |
run: .github/workflows/build-test.sh | |
- name: Test | |
uses: ./.github/actions/vmactions | |
with: | |
usesh: true | |
copyback: false | |
run: . ./test.sh | |
test-qemu: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: docker/setup-qemu-action@v3 | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: { go-version: stable } | |
- name: Git LFS pull | |
uses: ./.github/actions/lfs | |
- name: Test 386 (32-bit) | |
run: GOARCH=386 go test -v -short ./... | |
- name: Test arm64 (compiler) | |
run: GOARCH=arm64 go test -v -short ./... | |
- name: Test riscv64 (interpreter) | |
run: GOARCH=riscv64 go test -v -short ./... | |
- name: Test ppc64le (interpreter) | |
run: GOARCH=ppc64le go test -v -short ./... | |
- name: Test s390x (big-endian) | |
run: GOARCH=s390x go test -v -short -tags sqlite3_dotlk ./... | |
test-macintel: | |
runs-on: macos-13 | |
needs: test | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: { go-version: stable } | |
- name: Git LFS pull | |
uses: ./.github/actions/lfs | |
- name: Test | |
run: go test -v ./... |