From b735c26b50268c90b6a153b7203c5f607859541c Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 28 Jul 2024 17:20:13 -0700 Subject: [PATCH 1/5] Install Vulkan SDK in Windows CI --- .github/workflows/package.yml | 9 +-------- .github/workflows/rust.yml | 10 ++++++++-- 2 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 10a948e1..896c0a93 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -15,17 +15,10 @@ jobs: - uses: actions/checkout@v3 with: lfs: true - - name: Cache Vulkan SDK - id: cache-vulkan - uses: actions/cache@v4 - with: - path: ${{ env.VULKAN_SDK }} - key: vulkan-${{ env.VULKAN_VERSION }} - name: Install Vulkan SDK - if: steps.cache-vulkan.outputs.cache-hit != 'true' run: | Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_VERSION }}-Installer.exe" -OutFile vulkan.exe - 7z x -aoa vulkan.exe "-o$env:VULKAN_SDK" Lib share/vulkan/registry/vk.xml + ./vulkan.exe --accept-licenses --default-answer --confirm-command install - uses: actions-rs/toolchain@v1 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 945c3f92..153493cf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -13,6 +13,10 @@ jobs: runs-on: ${{ matrix.os }} + env: + VULKAN_VERSION: "1.3.231.1" + VULKAN_SDK: "C:/VulkanSDK/1.3.231.1" + steps: - name: Install shaderc if: matrix.os == 'ubuntu-latest' @@ -20,9 +24,11 @@ jobs: wget -nv -r -nd -A install.tgz 'https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html' tar xf install.tgz export SHADERC_LIB_DIR="$PWD/install/lib" - - name: Install Ninja + - name: Install Vulkan SDK if: matrix.os == 'windows-latest' - run: choco install ninja + run: | + Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_VERSION }}-Installer.exe" -OutFile vulkan.exe + ./vulkan.exe --accept-licenses --default-answer --confirm-command install - uses: actions/checkout@v1 - uses: actions-rs/toolchain@v1 From 823b8e3d99557084d8a70af0bfa6f320c2f83f2d Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 28 Jul 2024 17:37:40 -0700 Subject: [PATCH 2/5] Update Vulkan SDK for Windows CI --- .github/workflows/package.yml | 4 ++-- .github/workflows/rust.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 896c0a93..73b0d41d 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -9,8 +9,8 @@ jobs: name: Windows runs-on: windows-latest env: - VULKAN_VERSION: "1.3.231.1" - VULKAN_SDK: "C:/VulkanSDK/1.3.231.1" + VULKAN_VERSION: "1.3.290.0" + VULKAN_SDK: "C:/VulkanSDK/1.3.290.0" steps: - uses: actions/checkout@v3 with: diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 153493cf..0c6af399 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,8 +14,8 @@ jobs: runs-on: ${{ matrix.os }} env: - VULKAN_VERSION: "1.3.231.1" - VULKAN_SDK: "C:/VulkanSDK/1.3.231.1" + VULKAN_VERSION: "1.3.290.0" + VULKAN_SDK: "C:/VulkanSDK/1.3.290.0" steps: - name: Install shaderc From 6c0f60fd6b33acda546b745027e649c55ea2ee91 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 28 Jul 2024 17:41:18 -0700 Subject: [PATCH 3/5] Fix Linux CI shaderc install --- .github/workflows/package.yml | 7 +++++++ .github/workflows/rust.yml | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 73b0d41d..bb37d7e2 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -65,6 +65,13 @@ jobs: run: | yum install -y alsa-lib-devel vulkan-devel python3 fontconfig-devel + - name: Install shaderc + if: matrix.os == 'ubuntu-latest' + run: | + wget -nv -r -nd -A install.tgz 'https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html' + tar xf install.tgz + echo "SHADERC_LIB_DIR=$PWD/install/lib" >> "$GITHUB_ENV" + - uses: actions-rs/toolchain@v1 with: toolchain: stable diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0c6af399..0bcee2a3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,7 +23,7 @@ jobs: run: | wget -nv -r -nd -A install.tgz 'https://storage.googleapis.com/shaderc/badges/build_link_linux_clang_release.html' tar xf install.tgz - export SHADERC_LIB_DIR="$PWD/install/lib" + echo "SHADERC_LIB_DIR=$PWD/install/lib" >> "$GITHUB_ENV" - name: Install Vulkan SDK if: matrix.os == 'windows-latest' run: | From 1fa826df69c75f4f0782082455631d893b25f932 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 28 Jul 2024 17:50:56 -0700 Subject: [PATCH 4/5] Update checkout action --- .github/workflows/package.yml | 4 ++-- .github/workflows/rust.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index bb37d7e2..219495d9 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -12,7 +12,7 @@ jobs: VULKAN_VERSION: "1.3.290.0" VULKAN_SDK: "C:/VulkanSDK/1.3.290.0" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: lfs: true - name: Install Vulkan SDK @@ -58,7 +58,7 @@ jobs: - name: Install Git LFS run: | yum install -y git-lfs - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: lfs: true - name: Install dependencies diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0bcee2a3..8c0f48e2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,7 +30,7 @@ jobs: Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_VERSION }}-Installer.exe" -OutFile vulkan.exe ./vulkan.exe --accept-licenses --default-answer --confirm-command install - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -48,7 +48,7 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: actions-rs/toolchain@v1 with: profile: minimal @@ -69,7 +69,7 @@ jobs: name: Check protos runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v4 - uses: dtolnay/rust-toolchain@v1 with: profile: minimal From fb8104fbcb7f09ffd7af408556025eca244f2dd8 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 28 Jul 2024 17:57:33 -0700 Subject: [PATCH 5/5] Replace deprecated actions-rs with dtolnay/rust-toolchain --- .github/workflows/package.yml | 30 ++++++--------------------- .github/workflows/rust.yml | 38 ++++++++--------------------------- 2 files changed, 14 insertions(+), 54 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 219495d9..4659bdb1 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -20,23 +20,13 @@ jobs: Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_VERSION }}/windows/VulkanSDK-${{ env.VULKAN_VERSION }}-Installer.exe" -OutFile vulkan.exe ./vulkan.exe --accept-licenses --default-answer --confirm-command install - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true + - uses: dtolnay/rust-toolchain@stable - name: Build Server - uses: actions-rs/cargo@v1 - with: - command: build - args: --package server --release + run: cargo build --package server --release - name: Build Client - uses: actions-rs/cargo@v1 - with: - command: build - args: --package client --release --no-default-features + run: cargo build --package client --release --no-default-features - name: Package Artifacts run: | @@ -72,21 +62,13 @@ jobs: tar xf install.tgz echo "SHADERC_LIB_DIR=$PWD/install/lib" >> "$GITHUB_ENV" - - uses: actions-rs/toolchain@v1 - with: - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - name: Build Server - uses: actions-rs/cargo@v1 - with: - command: build - args: --package server --release + run: cargo build --package server --release - name: Build Client - uses: actions-rs/cargo@v1 - with: - command: build - args: --package client --release + run: cargo build --package client --release --no-default-features - name: Strip run: | diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 8c0f48e2..fc9a53c5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -31,49 +31,27 @@ jobs: ./vulkan.exe --accept-licenses --default-answer --confirm-command install - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 - with: - profile: minimal - toolchain: stable - override: true - - uses: actions-rs/cargo@v1 - with: - command: build - args: --workspace --all-targets - - uses: actions-rs/cargo@v1 - with: - command: test - args: --workspace + - uses: dtolnay/rust-toolchain@stable + - run: cargo build --workspace --all-targets + - run: cargo test --workspace lint: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions-rs/toolchain@v1 + - uses: dtolnay/rust-toolchain@stable with: - profile: minimal - toolchain: stable - override: true components: rustfmt, clippy - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: --all -- --check - - uses: actions-rs/cargo@v1 - if: always() - with: - command: clippy - args: --workspace --all-targets -- -D warnings + - run: cargo fmt --all -- --check + - if: always() + run: cargo clippy --workspace --all-targets -- -D warnings check-protos: name: Check protos runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@v1 - with: - profile: minimal - toolchain: stable + - uses: dtolnay/rust-toolchain@stable - run: sudo apt update && sudo apt-get -y install protobuf-compiler - name: Generate Rust code from .proto files run: cargo run -p gen-protos