Skip to content

chore(deps): Update module modernc.org/sqlite to v1.48.0 #30

chore(deps): Update module modernc.org/sqlite to v1.48.0

chore(deps): Update module modernc.org/sqlite to v1.48.0 #30

Workflow file for this run

name: Test GORM
on:
push:
branches:
- main
pull_request:
jobs:
# Label of the container job
gorm-test:
strategy:
matrix:
go: [ "oldstable", "stable" ]
platform: [ ubuntu-latest, macos-latest, windows-latest ]
runs-on: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v6
with:
path: sqlite
- name: Check out GORM
uses: actions/checkout@v6
with:
repository: go-gorm/gorm
path: gorm
- name: Setup Go
uses: actions/setup-go@v6
with:
cache: true
go-version: ${{ matrix.go }}
- name: Patch GORM tests to use libtnb/sqlite
working-directory: ./gorm/tests
shell: bash
# note portable syntax of sed (both GNU and BSD version work with -i.bak cheat, see https://stackoverflow.com/a/44864004
run: |
sed -i.bak '/gorm.io\/driver\/sqlite/d' go.mod
echo "replace github.com/libtnb/sqlite => ../../sqlite/" >> go.mod
sed -i.bak 's:gorm.io/driver/sqlite:github.com/libtnb/sqlite:g' tests_test.go
sed -i.bak 's:"gorm.db":"gorm.db?_txlock=immediate\&_pragma=busy_timeout(10000)\&_pragma=journal_mode(WAL)":g' tests_test.go
go mod tidy
cat go.mod
cat tests_test.go
- name: Run tests
working-directory: ./gorm/tests
shell: bash
run: go test -race -v -count=1 ./... 2>&1 > ${{ runner.os }}-${{ matrix.go }}-tests.out
- name: View failed tests result
if: ${{ failure() }}
working-directory: ./gorm/tests
shell: bash
run: grep FAIL -A10 -B3 ${{ runner.os }}-${{ matrix.go }}-tests.out || true
- name: Save tests results
if: ${{ always() }}
uses: actions/upload-artifact@v7
with:
name: ${{ runner.os }}-${{ matrix.go }}-tests.out
path: ./gorm/tests/${{ runner.os }}-${{ matrix.go }}-tests.out