mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 14:09:13 +00:00
174 lines
3.6 KiB
YAML
174 lines
3.6 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main" ]
|
|
pull_request:
|
|
branches: [ "main" ]
|
|
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 ./...
|
|
|
|
- name: Test BSD locks
|
|
run: go test -v -tags sqlite3_flock ./...
|
|
if: matrix.os == 'macos-latest'
|
|
|
|
- name: Test no shared memory
|
|
run: go test -v -tags sqlite3_noshm ./...
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
- name: Test no locks
|
|
run: go test -v -tags sqlite3_nosys ./...
|
|
if: matrix.os == 'ubuntu-latest'
|
|
|
|
- name: Test GORM
|
|
run: gormlite/test.sh
|
|
|
|
- uses: ncruces/go-coverage-report@v0
|
|
with:
|
|
chart: true
|
|
amend: true
|
|
if: |
|
|
github.event_name == 'push' &&
|
|
matrix.os == 'ubuntu-latest'
|
|
|
|
test-intel:
|
|
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 ./...
|
|
|
|
test-bsd:
|
|
runs-on: ubuntu-latest
|
|
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: Build
|
|
env:
|
|
GOOS: freebsd
|
|
TESTFLAGS: '-test.v'
|
|
run: .github/workflows/build-test.sh
|
|
|
|
- name: Test
|
|
uses: cross-platform-actions/action@v0.24.0
|
|
with:
|
|
operating_system: freebsd
|
|
version: '14.0'
|
|
shell: bash
|
|
run: . ./test.sh
|
|
sync_files: runner-to-vm
|
|
|
|
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 s390x (big-endian, z/OS)
|
|
run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./...
|
|
|
|
test-vm:
|
|
runs-on: ubuntu-latest
|
|
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: Build illumos
|
|
env:
|
|
GOOS: illumos
|
|
TESTFLAGS: '-test.v -test.short'
|
|
run: .github/workflows/build-test.sh
|
|
|
|
- name: Test illumos
|
|
uses: vmactions/omnios-vm@v1
|
|
with:
|
|
usesh: true
|
|
copyback: false
|
|
run: . ./test.sh
|
|
|
|
- name: Build Solaris
|
|
env:
|
|
GOOS: solaris
|
|
TESTFLAGS: '-test.v -test.short'
|
|
run: .github/workflows/build-test.sh
|
|
|
|
- name: Test Solaris
|
|
uses: vmactions/solaris-vm@v1
|
|
with:
|
|
usesh: true
|
|
copyback: false
|
|
run: . ./test.sh
|
|
continue-on-error: true |