From da0e98f17e6b2bc28ec62da051efaf6a8c7a138d Mon Sep 17 00:00:00 2001 From: Nuno Cruces Date: Fri, 2 Feb 2024 19:10:56 +0000 Subject: [PATCH] BSD tests. --- .github/workflows/bsd.sh | 10 ++++++++++ .github/workflows/bsd.yml | 13 ++++++++++--- .github/workflows/cpu.yml | 2 +- .github/workflows/cross.sh | 1 + 4 files changed, 22 insertions(+), 4 deletions(-) create mode 100755 .github/workflows/bsd.sh diff --git a/.github/workflows/bsd.sh b/.github/workflows/bsd.sh new file mode 100755 index 0000000..b9a4d20 --- /dev/null +++ b/.github/workflows/bsd.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +echo 'set -euo pipefail' > 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 +done \ No newline at end of file diff --git a/.github/workflows/bsd.yml b/.github/workflows/bsd.yml index 1aa1b0d..8e1e651 100644 --- a/.github/workflows/bsd.yml +++ b/.github/workflows/bsd.yml @@ -12,13 +12,20 @@ jobs: with: lfs: 'true' + - name: Set up + uses: actions/setup-go@v5 + with: + go-version: stable + + - name: Build + run: .github/workflows/bsd.sh + - name: Test uses: cross-platform-actions/action@v0.22.0 with: operating_system: freebsd version: '13.2' memory: 8G + shell: bash sync_files: runner-to-vm - run: | - sudo pkg install -y go121 - go121 test -v ./... + run: source test.sh diff --git a/.github/workflows/cpu.yml b/.github/workflows/cpu.yml index 4cb2400..956f143 100644 --- a/.github/workflows/cpu.yml +++ b/.github/workflows/cpu.yml @@ -53,4 +53,4 @@ jobs: go-version: stable - name: Test - run: go test -v ./... \ No newline at end of file + run: go test -v ./... diff --git a/.github/workflows/cross.sh b/.github/workflows/cross.sh index 9c7c9b0..883663b 100755 --- a/.github/workflows/cross.sh +++ b/.github/workflows/cross.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -euo pipefail echo android ; GOOS=android GOARCH=amd64 go build . echo darwin ; GOOS=darwin GOARCH=amd64 go build .