Use correct seperation in each place needed when loading LFS (#837)
https://github.com/actions/toolkit/blob/d70fb49aaa0517f8c92e4e2e9406c8a5414f3fec/packages/glob/src/glob.ts#L11
indicated that newlines were supported, and it worked
It requires a few hacks, but I think this is a more robust long-term state
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index bb46196..5f70ccd 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -15,8 +15,8 @@
# List of packages that can not target Wasm.
# `vello_tests` uses `nv-flip`, which doesn't support Wasm.
NO_WASM_PKGS: "--exclude vello_tests --exclude simple_sdl2"
- # The files stored in LFS the tests need to access
- LFS_FILES: "vello_tests/snapshots/*.png,sparse_strips/vello_cpu/refs/*.png"
+ # The files stored in LFS the tests need to access, in JSON format
+ LFS_FILES: '["vello_tests/snapshots/*.png", "sparse_strips/vello_cpu/refs/*.png"]'
# Rationale
@@ -168,7 +168,8 @@
- id: calc-hash
name: Calculate LFS hash
- run: echo "result=${{ hashFiles(env.LFS_FILES) }}" | tee -a "$GITHUB_OUTPUT"
+ # GitHub's expression context doesn't support either a literal newline or an escaped newline. We have to use the JSON parser to get a newline character.
+ run: echo "result=${{ hashFiles(join(fromJson(env.LFS_FILES), fromJson('"\n"'))) }}" | tee -a "$GITHUB_OUTPUT"
- name: Cache git lfs
id: lfs-cache
@@ -182,7 +183,7 @@
- name: Fetch lfs data
if: ${{ steps.lfs-cache.outputs.cache-hit != 'true' }}
- run: git lfs fetch --include '${{ env.LFS_FILES }}'
+ run: git lfs fetch --include '${{ join(fromJson(env.LFS_FILES), ',') }}'
test-stable:
name: cargo test
@@ -215,7 +216,10 @@
enableCrossOsArchive: true
- name: Checkout LFS files
- run: git lfs checkout '${{ env.LFS_FILES }}'
+ # `git lfs checkout` requires that each individual glob is a separate command line argument.
+ # The string `''' '''` is how you write `' '` in GitHub's expression context (i.e. two quotes separated by a space)
+ # The quotes are to avoid the shell from evaluating the globs itself.
+ run: git lfs checkout '${{ join(fromJson(env.LFS_FILES), ''' ''') }}'
continue-on-error: true
- name: install stable toolchain