Update CI workflow to download and install Vulkan SDK dynamically #22
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| permissions: | |
| pages: write | |
| id-token: write | |
| on: | |
| push: | |
| branches: [ master ] | |
| pull_request: | |
| branches: [ master ] | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ ubuntu-latest, windows-latest, macos-latest ] | |
| rust: [ stable, beta, nightly ] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: true | |
| - name: Set up Rust | |
| uses: actions-rs/toolchain@v1 | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| override: true | |
| components: rustfmt, clippy | |
| - name: Cache Cargo registry | |
| if: runner.os != 'Windows' | |
| uses: actions/cache@v4 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-registry- | |
| - name: Dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| wget -qO- https://packages.lunarg.com/lunarg-signing-key-pub.asc | sudo tee /etc/apt/trusted.gpg.d/lunarg.asc | |
| sudo wget -qO /etc/apt/sources.list.d/lunarg-vulkan-noble.list http://packages.lunarg.com/vulkan/lunarg-vulkan-noble.list | |
| sudo apt update | |
| sudo apt install vulkan-sdk | |
| - name: Dependencies | |
| if: runner.os == 'macOS' | |
| run: | | |
| SDK_VERSION=$(curl -s https://vulkan.lunarg.com/sdk/latest/mac.txt) | |
| curl -O https://sdk.lunarg.com/sdk/download/${SDK_VERSION}/mac/vulkan_sdk.zip | |
| unzip vulkan_sdk.zip -d vulkan_sdk | |
| sudo installer -pkg vulkan_sdk/vulkan_sdk.pkg -target / | |
| - name: Dependencies | |
| if: runner.os == 'Windows' | |
| run: | | |
| $SDK_VERSION = Invoke-RestMethod -Uri https://vulkan.lunarg.com/sdk/latest/windows.txt | |
| Invoke-WebRequest -Uri https://sdk.lunarg.com/sdk/download/$SDK_VERSION/windows/vulkan_sdk.exe -OutFile vulkan_sdk.exe | |
| Start-Process -FilePath vulkan_sdk.exe -ArgumentList "/S" -Wait | |
| - run: cargo build --verbose --workspace --all-targets | |
| - run: cargo check --verbose --workspace --all-targets | |
| - run: cargo clippy --verbose --workspace --all-targets -- -D warnings | |
| - run: cargo fmt --all -- --check | |
| - run: cargo test --verbose --workspace --all-targets --no-fail-fast --lib --bins --examples --tests --benches | |
| - run: cargo build --verbose --workspace --all-targets --all-features | |
| - run: cargo check --verbose --workspace --all-targets --all-features | |
| - run: cargo clippy --verbose --workspace --all-targets --all-features -- -D warnings | |
| - run: cargo fmt --all -- --check | |
| - run: cargo test --verbose --workspace --all-targets --all-features --no-fail-fast --lib --bins --examples --tests --benches | |
| - run: git diff --exit-code | |
| - name: Generate cargo docs | |
| if: ${{ github.event_name == 'push' && matrix.rust == 'stable' }} | |
| run: cargo doc --workspace --no-deps | |
| - name: Upload artifact | |
| if: ${{ github.event_name == 'push' && matrix.rust == 'stable' }} | |
| uses: actions/upload-pages-artifact@v3 | |
| with: | |
| path: "./target/doc" | |
| - name: Deploy to GitHub Pages | |
| if: ${{ github.event_name == 'push' && matrix.rust == 'stable' }} | |
| id: deployment | |
| uses: actions/deploy-pages@v4 | |