From 1c58744f87bc14da9c8514d3d6e31ebf0d4182c5 Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Sat, 4 May 2024 14:42:23 +0100 Subject: [PATCH] Test Solaris. --- .github/workflows/{bsd.sh => build-test.sh} | 4 +- .github/workflows/illumos.sh | 11 ---- .github/workflows/test.yml | 67 +++++++++++++-------- README.md | 3 +- 4 files changed, 47 insertions(+), 38 deletions(-) rename .github/workflows/{bsd.sh => build-test.sh} (58%) delete mode 100755 .github/workflows/illumos.sh diff --git a/.github/workflows/bsd.sh b/.github/workflows/build-test.sh similarity index 58% rename from .github/workflows/bsd.sh rename to .github/workflows/build-test.sh index c32ce30..44f5b1a 100755 --- a/.github/workflows/bsd.sh +++ b/.github/workflows/build-test.sh @@ -6,6 +6,6 @@ echo 'set -eu' > test.sh for p in $(go list ./...); do dir=".${p#github.com/ncruces/go-sqlite3}" name="$(basename "$p").test" - (cd ${dir}; GOOS=freebsd go test -c) - [ -f "${dir}/${name}" ] && echo "(cd ${dir}; ./${name} -test.v)" >> test.sh + (cd ${dir}; go test -c) + [ -f "${dir}/${name}" ] && echo "(cd ${dir}; ./${name} ${TESTFLAGS})" >> test.sh done \ No newline at end of file diff --git a/.github/workflows/illumos.sh b/.github/workflows/illumos.sh deleted file mode 100755 index 9e5ed3d..0000000 --- a/.github/workflows/illumos.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -echo 'set -eu' > test.sh - -for p in $(go list ./...); do - dir=".${p#github.com/ncruces/go-sqlite3}" - name="$(basename "$p").test" - (cd ${dir}; GOOS=illumos go test -c) - [ -f "${dir}/${name}" ] && echo "(cd ${dir}; ./${name} -test.v -test.short)" >> test.sh -done \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ca313f7..e74daa1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -78,7 +78,10 @@ jobs: with: { go-version: stable } - name: Build - run: .github/workflows/bsd.sh + env: + GOOS: freebsd + TESTFLAGS: '-test.v' + run: .github/workflows/build-test.sh - name: Test uses: cross-platform-actions/action@v0.24.0 @@ -88,28 +91,7 @@ jobs: shell: bash run: . ./test.sh sync_files: runner-to-vm - - test-illumos: - runs-on: ubuntu-latest - needs: test - - steps: - - uses: actions/checkout@v4 - with: { lfs: 'true' } - - - uses: actions/setup-go@v5 - with: { go-version: stable } - - - name: Build - run: .github/workflows/illumos.sh - - - name: Test - uses: vmactions/omnios-vm@v1 - with: - usesh: true - copyback: false - run: . ./test.sh - + test-m1: runs-on: macos-14 needs: test @@ -147,4 +129,41 @@ jobs: run: GOARCH=riscv64 go test -v -short ./... - name: Test s390x (like z/OS) - run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./... \ No newline at end of file + run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./... + + test-vm: + runs-on: ubuntu-latest + needs: test + + steps: + - uses: actions/checkout@v4 + with: { lfs: 'true' } + + - uses: actions/setup-go@v5 + with: { go-version: stable } + + - 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 diff --git a/README.md b/README.md index 3cf5b4a..d3ffb2b 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,8 @@ It also benefits greatly from [SQLite's](https://sqlite.org/testing.html) and [wazero's](https://tetrate.io/blog/introducing-wazero-from-tetrate/#:~:text=Rock%2Dsolid%20test%20approach) thorough testing. Every commit is [tested](.github/workflows/test.yml) on -Linux (amd64/arm64/386/riscv64), macOS (amd64/arm64), Windows, FreeBSD and illumos. +Linux (amd64/arm64/386/riscv64/s390x), macOS (amd64/arm64), +Windows, FreeBSD, illumos, and Solaris. The Go VFS is tested by running SQLite's [mptest](https://github.com/sqlite/sqlite/blob/master/mptest/mptest.c).