Skip to content

Commit 4d0c7b1

Browse files
committed
[update] workflows to run tests using wgpu & to build examples.
1 parent 2660dd2 commit 4d0c7b1

File tree

2 files changed

+37
-36
lines changed

2 files changed

+37
-36
lines changed

.github/workflows/compile_lambda_rs.yml

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: compile & test lambda-rs
1+
name: compile & test lambda-rs (wgpu)
22

33
on:
44
push:
@@ -21,53 +21,52 @@ jobs:
2121
matrix:
2222
include:
2323
- os: ubuntu-latest
24-
rustup-toolchain: "stable"
25-
features: "lambda-rs/with-opengl"
26-
- os: ubuntu-latest
27-
rustup-toolchain: "stable"
28-
features: "lambda-rs/with-vulkan"
29-
- os: windows-latest
3024
rustup-toolchain: "stable"
3125
features: "lambda-rs/with-vulkan"
32-
- os: windows-latest
33-
rustup-toolchain: "stable"
34-
features: "lambda-rs/with-dx11"
3526
- os: windows-latest
3627
rustup-toolchain: "stable"
3728
features: "lambda-rs/with-dx12"
38-
- os: macos-latest
39-
rustup-toolchain: "stable"
40-
features: "lambda-rs/with-opengl"
4129
- os: macos-latest
4230
rustup-toolchain: "stable"
4331
features: "lambda-rs/with-metal"
4432

4533
steps:
4634
- name: Checkout Repository
47-
uses: actions/checkout@v2
35+
uses: actions/checkout@v4
36+
37+
- name: Cache cargo builds
38+
uses: Swatinem/rust-cache@v2
4839

4940
- name: Run the projects setup.
5041
run: ./scripts/setup.sh --within-ci true
5142

52-
- name: Obtain Xorg for building on Ubuntu.
43+
- name: Install Linux deps for winit/wgpu
5344
if: ${{ matrix.os == 'ubuntu-latest' }}
54-
run: sudo apt-get update && sudo apt-get install xorg-dev
55-
56-
- name: Add msbuild to PATH
57-
if: ${{ matrix.os == 'windows-latest' }}
58-
uses: microsoft/[email protected]
45+
run: |
46+
sudo apt-get update
47+
sudo apt-get install -y \
48+
pkg-config libx11-dev libxcb1-dev libxcb-render0-dev \
49+
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
50+
libwayland-dev libudev-dev libvulkan-dev
5951
60-
- name: Install ninja 1.10.2 on windows.
61-
if: ${{ matrix.os == 'windows-latest' }}
62-
run: choco install ninja
52+
# Windows runners already include the required toolchain for DX12 builds.
6353

6454
- name: Obtain rust toolchain for ${{ matrix.rustup-toolchain }}
6555
run: |
6656
rustup toolchain install ${{ matrix.rustup-toolchain }}
6757
rustup default ${{ matrix.rustup-toolchain }}
6858
69-
- name: Build Lambda & other default workspace members.
70-
run: cargo test --all --features ${{ matrix.features }} --no-default-features
59+
- name: Check formatting
60+
run: cargo fmt --all --check
61+
62+
- name: Build workspace
63+
run: cargo build --workspace --features ${{ matrix.features }} --no-default-features
64+
65+
- name: Build examples (lambda-rs)
66+
run: cargo build -p lambda-rs --examples --features ${{ matrix.features }} --no-default-features
67+
68+
- name: Test workspace
69+
run: cargo test --workspace --features ${{ matrix.features }} --no-default-features
7170

7271
- uses: actions/setup-ruby@v1
7372
- name: Send Webhook Notification for build status.

.github/workflows/lambda-repo-security.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# More details at https://github.com/rust-lang/rust-clippy
88
# and https://rust-lang.github.io/rust-clippy/
99

10-
name: rust-clippy analyze
10+
name: rust fmt + clippy analyze
1111

1212
on:
1313
push:
@@ -28,28 +28,30 @@ jobs:
2828
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
2929
steps:
3030
- name: Checkout code
31-
uses: actions/checkout@v2
31+
uses: actions/checkout@v4
32+
33+
- name: Cache cargo builds
34+
uses: Swatinem/rust-cache@v2
3235

3336
- name: Install Rust toolchain
34-
uses: actions-rs/toolchain@16499b5e05bf2e26879000db0c1d13f7e13fa3af #@v1
37+
uses: dtolnay/rust-toolchain@stable
3538
with:
36-
profile: minimal
37-
toolchain: stable
3839
components: clippy
39-
override: true
4040

4141
- name: Install dependencies for converting clippy output to SARIF
4242
run: cargo install clippy-sarif sarif-fmt
4343

44+
- name: Check formatting
45+
run: cargo fmt --all --check
46+
4447
- name: Run rust-clippy
45-
run:
46-
cargo clippy
47-
--all-features
48-
--message-format=json | clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
48+
run: |
49+
cargo clippy --workspace --all-targets --all-features --message-format=json -- -D warnings \
50+
| clippy-sarif | tee rust-clippy-results.sarif | sarif-fmt
4951
continue-on-error: true
5052

5153
- name: Upload analysis results to GitHub
52-
uses: github/codeql-action/upload-sarif@v1
54+
uses: github/codeql-action/upload-sarif@v3
5355
with:
5456
sarif_file: rust-clippy-results.sarif
5557
wait-for-processing: true

0 commit comments

Comments
 (0)