Skip to content

Commit

Permalink
Use GLSL shaders from cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
zlogic committed Jan 23, 2024
1 parent 1c4e6f7 commit 6f25cd9
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions .github/workflows/cargo-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ jobs:
- name: Build SPIR-V shaders with glslang
run: glslangValidator -V -g0 src/shaders/correlation.comp.glsl -o src/shaders/correlation.spv

- name: Validate Rust code with clippy
run: cargo clippy

- name: Upload SPIR-V shaders
uses: actions/upload-artifact@v4
- name: Cache SPIR-V shaders
uses: actions/cache/save@v4
with:
name: shaders-spv
path: src/shaders/correlation.spv
key: shaders-${{ hashFiles('src/shaders/correlation.comp.glsl') }}

- name: Validate Rust code with clippy
run: cargo clippy

build-linux:
# Older Ubuntu versions will link with an older GLIBC and provide better compatibility
Expand Down Expand Up @@ -88,10 +88,12 @@ jobs:
echo "CFLAGS=-march=armv8.2-a" >> $GITHUB_ENV
echo "CXXFLAGS=-march=armv8.2-a" >> $GITHUB_ENV
- name: Download SPIR-V shaders
uses: actions/download-artifact@v4
- name: Restore SPIR-V shaders from cache
uses: actions/cache/restore@v4
with:
name: shaders-spv
path: src/shaders/correlation.spv
key: shaders-${{ hashFiles('src/shaders/correlation.comp.glsl') }}
fail-on-cache-miss: true

- name: Build
run: cargo build --target=${{ matrix.arch }}-unknown-linux-gnu --release
Expand Down Expand Up @@ -137,10 +139,13 @@ jobs:
if: matrix.arch == 'aarch64'
run: rustup target add ${{ matrix.arch }}-pc-windows-msvc

- name: Download SPIR-V shaders
uses: actions/download-artifact@v4
- name: Restore SPIR-V shaders from cache
uses: actions/cache/restore@v4
with:
name: shaders-spv
path: src/shaders/correlation.spv
key: shaders-${{ hashFiles('src/shaders/correlation.comp.glsl') }}
fail-on-cache-miss: true
enableCrossOsArchive: true

- name: Build
run: |
Expand Down

0 comments on commit 6f25cd9

Please sign in to comment.