Skip to content

Commit 12111a6

Browse files
committed
Cache LFS.
1 parent 1c58744 commit 12111a6

File tree

4 files changed

+46
-24
lines changed

4 files changed

+46
-24
lines changed

.github/actions/lfs/action.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: LFS pull
2+
description: Cached LFS pull.
3+
4+
runs:
5+
using: "composite"
6+
steps:
7+
- name: Create LFS file list
8+
shell: bash
9+
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
10+
11+
- name: Restore LFS cache
12+
uses: actions/cache@v4
13+
with:
14+
path: .git/lfs/objects
15+
key: lfs-${{ hashFiles('.lfs-assets-id') }}
16+
restore-keys: lfs-
17+
enableCrossOsArchive: true
18+
19+
- name: Git LFS Pull
20+
shell: bash
21+
run: git lfs pull

.github/workflows/test.yml

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616

1717
steps:
1818
- uses: actions/checkout@v4
19-
with: { lfs: 'true' }
19+
- uses: ./.github/actions/lfs
2020

2121
- uses: actions/setup-go@v5
2222
with: { go-version: stable }
@@ -66,13 +66,27 @@ jobs:
6666
github.event_name == 'push' &&
6767
matrix.os == 'ubuntu-latest'
6868
69+
test-m1:
70+
runs-on: macos-14
71+
needs: test
72+
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: ./.github/actions/lfs
76+
77+
- uses: actions/setup-go@v5
78+
with: { go-version: stable }
79+
80+
- name: Test
81+
run: go test -v ./...
82+
6983
test-bsd:
7084
runs-on: ubuntu-latest
7185
needs: test
7286

7387
steps:
7488
- uses: actions/checkout@v4
75-
with: { lfs: 'true' }
89+
- uses: ./.github/actions/lfs
7690

7791
- uses: actions/setup-go@v5
7892
with: { go-version: stable }
@@ -91,44 +105,30 @@ jobs:
91105
shell: bash
92106
run: . ./test.sh
93107
sync_files: runner-to-vm
94-
95-
test-m1:
96-
runs-on: macos-14
97-
needs: test
98-
99-
steps:
100-
- uses: actions/checkout@v4
101-
with: { lfs: 'true' }
102-
103-
- uses: actions/setup-go@v5
104-
with: { go-version: stable }
105-
106-
- name: Test
107-
run: go test -v ./...
108108

109109
test-qemu:
110110
runs-on: ubuntu-latest
111111
needs: test
112112

113113
steps:
114114
- uses: actions/checkout@v4
115-
with: { lfs: 'true' }
115+
- uses: ./.github/actions/lfs
116116

117117
- uses: actions/setup-go@v5
118118
with: { go-version: stable }
119119

120120
- uses: docker/setup-qemu-action@v3
121121

122-
- name: Test 386
122+
- name: Test 386 (32-bit)
123123
run: GOARCH=386 go test -v -short ./...
124124

125-
- name: Test arm64
125+
- name: Test arm64 (compiler)
126126
run: GOARCH=arm64 go test -v -short ./...
127127

128-
- name: Test riscv64
128+
- name: Test riscv64 (interpreter)
129129
run: GOARCH=riscv64 go test -v -short ./...
130130

131-
- name: Test s390x (like z/OS)
131+
- name: Test s390x (big-endian, z/OS)
132132
run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./...
133133

134134
test-vm:
@@ -137,7 +137,7 @@ jobs:
137137

138138
steps:
139139
- uses: actions/checkout@v4
140-
with: { lfs: 'true' }
140+
- uses: ./.github/actions/lfs
141141

142142
- uses: actions/setup-go@v5
143143
with: { go-version: stable }

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ It also benefits greatly from [SQLite's](https://sqlite.org/testing.html) and
8989

9090
Every commit is [tested](.github/workflows/test.yml) on
9191
Linux (amd64/arm64/386/riscv64/s390x), macOS (amd64/arm64),
92-
Windows, FreeBSD, illumos, and Solaris.
92+
Windows (amd64), FreeBSD (amd64), illumos (amd64), and Solaris (amd64).
93+
9394
The Go VFS is tested by running SQLite's
9495
[mptest](https://github.com/sqlite/sqlite/blob/master/mptest/mptest.c).
9596

tests/conn_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ func TestConn_DBName(t *testing.T) {
497497
func TestConn_AutoVacuumPages(t *testing.T) {
498498
t.Parallel()
499499

500-
db, err := sqlite3.Open("file:test.db?vfs=memdb&_pragma=auto_vacuum(FULL)")
500+
db, err := sqlite3.Open("file:test.db?vfs=memdb&_pragma=auto_vacuum(full)")
501501
if err != nil {
502502
t.Fatal(err)
503503
}

0 commit comments

Comments
 (0)