mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 5 to 6. - [Release notes](https://github.com/actions/setup-go/releases) - [Commits](https://github.com/actions/setup-go/compare/v5...v6) --- updated-dependencies: - dependency-name: actions/setup-go dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
236 lines
5.2 KiB
YAML
236 lines
5.2 KiB
YAML
name: Test
|
|
|
|
on:
|
|
push:
|
|
branches: [ 'main' ]
|
|
paths:
|
|
- '**.go'
|
|
- '**.mod'
|
|
- '**.wasm'
|
|
- '**.yml'
|
|
pull_request:
|
|
branches: [ 'main' ]
|
|
paths:
|
|
- '**.go'
|
|
- '**.mod'
|
|
- '**.wasm'
|
|
- '**.yml'
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
test:
|
|
strategy:
|
|
matrix:
|
|
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
runs-on: ${{ matrix.os }}
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v6
|
|
with: { go-version: stable }
|
|
|
|
- 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 BSD locks
|
|
run: go test -v -tags sqlite3_flock ./...
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
- name: Test dot locks
|
|
run: go test -v -tags sqlite3_dotlk ./...
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
- name: Test modules
|
|
shell: bash
|
|
run: |
|
|
go work init .
|
|
go work use -r embed gormlite
|
|
go test -v ./embed/bcw2/...
|
|
|
|
- name: Test GORM
|
|
shell: bash
|
|
run: gormlite/test.sh
|
|
if: matrix.os != 'windows-latest'
|
|
|
|
- name: Collect coverage
|
|
run: |
|
|
go get -tool github.com/dave/courtney@v0.4.4
|
|
go tool courtney
|
|
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.3'
|
|
flags: '-test.v'
|
|
- name: netbsd
|
|
version: '10.1'
|
|
flags: '-test.v'
|
|
- name: freebsd
|
|
arch: arm64
|
|
version: '14.3'
|
|
flags: '-test.v -test.short'
|
|
- name: netbsd
|
|
arch: arm64
|
|
version: '10.1'
|
|
flags: '-test.v -test.short'
|
|
- name: openbsd
|
|
version: '7.7'
|
|
flags: '-test.v -test.short'
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Build
|
|
env:
|
|
GOOS: ${{ matrix.os.name }}
|
|
GOARCH: ${{ matrix.os.arch }}
|
|
TESTFLAGS: ${{ matrix.os.flags }}
|
|
run: .github/workflows/build-test.sh
|
|
|
|
- name: Test
|
|
uses: cross-platform-actions/action@v0.29.0
|
|
with:
|
|
operating_system: ${{ matrix.os.name }}
|
|
architecture: ${{ matrix.os.arch }}
|
|
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'
|
|
tflags: '-test.v'
|
|
- name: illumos
|
|
action: 'vmactions/omnios-vm@v1'
|
|
tflags: '-test.v'
|
|
- name: solaris
|
|
action: 'vmactions/solaris-vm@v1'
|
|
bflags: '-tags sqlite3_dotlk'
|
|
tflags: '-test.v'
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
|
|
- name: Build
|
|
env:
|
|
GOOS: ${{ matrix.os.name }}
|
|
BUILDFLAGS: ${{ matrix.os.bflags }}
|
|
TESTFLAGS: ${{ matrix.os.tflags }}
|
|
VMACTIONS: ${{ matrix.os.action }}
|
|
run: .github/workflows/build-test.sh
|
|
|
|
- name: Test
|
|
uses: ./.github/actions/vmactions
|
|
|
|
test-wasip1:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: bytecodealliance/actions/wasmtime/setup@v1
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v6
|
|
with: { go-version: stable }
|
|
|
|
- name: Set path
|
|
run: echo "$(go env GOROOT)/lib/wasm" >> "$GITHUB_PATH"
|
|
|
|
- name: Test wasmtime
|
|
env:
|
|
GOOS: wasip1
|
|
GOARCH: wasm
|
|
GOWASIRUNTIME: wasmtime
|
|
GOWASIRUNTIMEARGS: '--env CI=true'
|
|
run: go test -v -short -tags sqlite3_dotlk -skip Example ./...
|
|
|
|
test-qemu:
|
|
runs-on: ubuntu-latest
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: docker/setup-qemu-action@v3
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v6
|
|
with: { go-version: stable }
|
|
|
|
- name: Test 386 (32-bit)
|
|
run: GOARCH=386 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-linuxarm:
|
|
runs-on: ubuntu-24.04-arm
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v6
|
|
with: { go-version: stable }
|
|
|
|
- name: Test
|
|
run: go test -v ./...
|
|
|
|
test-macintel:
|
|
runs-on: macos-13
|
|
needs: test
|
|
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
- uses: actions/setup-go@v6
|
|
with: { go-version: stable }
|
|
|
|
- name: Test
|
|
run: go test -v ./... |