Skip to content

Update CI.yaml

Update CI.yaml #36

Workflow file for this run

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: |
curl -L -o vulkansdk-macos.dmg https://sdk.lunarg.com/sdk/download/1.3.290.0/mac/vulkansdk-macos-1.3.290.0.dmg
hdiutil attach vulkansdk-macos.dmg
pkg_path=$(find /Volumes/vulkansdk-macos-1.3.290.0 -maxdepth 1 -name "*.pkg" | head -n 1)
sudo installer -pkg "$pkg_path" -target /
hdiutil detach /Volumes/vulkansdk-macos-1.3.290.0
echo "VULKAN_SDK=/usr/local/vulkansdk/1.3.290.0" >> $GITHUB_ENV
- name: Dependencies
if: runner.os == 'Windows'
run: |
$SDK_VERSION = (Invoke-RestMethod -Uri "https://vulkan.lunarg.com/sdk/latest/windows.txt").Trim()
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 "in", "--al", "--confirm-command" -Wait
$env:VULKAN_SDK = "C:\VulkanSDK\$SDK_VERSION"
$env:LIB += ";$env:VULKAN_SDK\Lib"
echo "VULKAN_SDK=$env:VULKAN_SDK" >> $env:GITHUB_ENV
echo "LIB=$env:LIB" >> $env:GITHUB_ENV
- 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' && runner.os == 'Linux' }}
run: cargo doc --workspace --no-deps
- name: Upload artifact
if: ${{ github.event_name == 'push' && matrix.rust == 'stable' && runner.os == 'Linux' }}
uses: actions/upload-pages-artifact@v3
with:
path: "./target/doc"
- name: Deploy to GitHub Pages
if: ${{ github.event_name == 'push' && matrix.rust == 'stable' && runner.os == 'Linux' }}
id: deployment
uses: actions/deploy-pages@v4