Cache LFS.

This commit is contained in:
Nuno Cruces
2024-05-05 23:18:58 +01:00
parent 1c58744f87
commit 12111a619a
4 changed files with 46 additions and 24 deletions

21
.github/actions/lfs/action.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: LFS pull
description: Cached LFS pull.
runs:
using: "composite"
steps:
- name: Create LFS file list
shell: bash
run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id
- name: Restore LFS cache
uses: actions/cache@v4
with:
path: .git/lfs/objects
key: lfs-${{ hashFiles('.lfs-assets-id') }}
restore-keys: lfs-
enableCrossOsArchive: true
- name: Git LFS Pull
shell: bash
run: git lfs pull

View File

@@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with: { lfs: 'true' }
- uses: ./.github/actions/lfs
- uses: actions/setup-go@v5
with: { go-version: stable }
@@ -66,13 +66,27 @@ jobs:
github.event_name == 'push' &&
matrix.os == 'ubuntu-latest'
test-m1:
runs-on: macos-14
needs: test
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/lfs
- uses: actions/setup-go@v5
with: { go-version: stable }
- name: Test
run: go test -v ./...
test-bsd:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
with: { lfs: 'true' }
- uses: ./.github/actions/lfs
- uses: actions/setup-go@v5
with: { go-version: stable }
@@ -91,20 +105,6 @@ jobs:
shell: bash
run: . ./test.sh
sync_files: runner-to-vm
test-m1:
runs-on: macos-14
needs: test
steps:
- uses: actions/checkout@v4
with: { lfs: 'true' }
- uses: actions/setup-go@v5
with: { go-version: stable }
- name: Test
run: go test -v ./...
test-qemu:
runs-on: ubuntu-latest
@@ -112,23 +112,23 @@ jobs:
steps:
- uses: actions/checkout@v4
with: { lfs: 'true' }
- uses: ./.github/actions/lfs
- uses: actions/setup-go@v5
with: { go-version: stable }
- uses: docker/setup-qemu-action@v3
- name: Test 386
- name: Test 386 (32-bit)
run: GOARCH=386 go test -v -short ./...
- name: Test arm64
- name: Test arm64 (compiler)
run: GOARCH=arm64 go test -v -short ./...
- name: Test riscv64
- name: Test riscv64 (interpreter)
run: GOARCH=riscv64 go test -v -short ./...
- name: Test s390x (like z/OS)
- name: Test s390x (big-endian, z/OS)
run: GOARCH=s390x go test -v -short -tags sqlite3_flock ./...
test-vm:
@@ -137,7 +137,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with: { lfs: 'true' }
- uses: ./.github/actions/lfs
- uses: actions/setup-go@v5
with: { go-version: stable }