Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up CI #423

Merged
merged 5 commits into from
Jul 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 18 additions & 36 deletions .github/workflows/package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,24 @@ 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
- uses: actions/checkout@v4
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:
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: |
Expand All @@ -65,28 +48,27 @@ 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
run: |
yum install -y alsa-lib-devel vulkan-devel python3 fontconfig-devel

- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- 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: 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: |
Expand Down
56 changes: 20 additions & 36 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,45 @@ jobs:

runs-on: ${{ matrix.os }}

env:
VULKAN_VERSION: "1.3.290.0"
VULKAN_SDK: "C:/VulkanSDK/1.3.290.0"

steps:
- 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
export SHADERC_LIB_DIR="$PWD/install/lib"
- name: Install Ninja
echo "SHADERC_LIB_DIR=$PWD/install/lib" >> "$GITHUB_ENV"
- 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
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: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- run: cargo build --workspace --all-targets
- run: cargo test --workspace

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
- uses: actions/checkout@v4
- 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@v1
- uses: dtolnay/rust-toolchain@v1
with:
profile: minimal
toolchain: stable
- uses: actions/checkout@v4
- 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
Expand Down