-
Notifications
You must be signed in to change notification settings - Fork 2
110 lines (92 loc) · 3.69 KB
/
compile_lambda_rs.yml
File metadata and controls
110 lines (92 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
name: compile & test lambda-rs (wgpu)
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build_and_test:
name: Build lambda-rs on ${{ matrix.os }} with features ${{ matrix.features }}.
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
rustup-toolchain: "stable"
features: "lambda-rs/with-vulkan"
- os: ubuntu-latest
rustup-toolchain: "stable"
features: "lambda-rs/with-vulkan,lambda-rs/audio-output-device"
- os: windows-latest
rustup-toolchain: "stable"
features: "lambda-rs/with-dx12"
- os: windows-latest
rustup-toolchain: "stable"
features: "lambda-rs/with-dx12,lambda-rs/audio-output-device"
- os: macos-latest
rustup-toolchain: "stable"
features: "lambda-rs/with-metal"
- os: macos-latest
rustup-toolchain: "stable"
features: "lambda-rs/with-metal,lambda-rs/audio-output-device"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Cache cargo builds
uses: Swatinem/rust-cache@v2
- name: Run the projects setup.
run: ./scripts/setup.sh --within-ci true
- name: Install Linux deps for winit/wgpu
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt-get update
sudo apt-get install -y \
pkg-config libx11-dev libxcb1-dev libxcb-render0-dev \
libxcb-shape0-dev libxcb-xfixes0-dev libxkbcommon-dev \
libwayland-dev libudev-dev \
libvulkan-dev libvulkan1 mesa-vulkan-drivers vulkan-tools
- name: Install Linux deps for audio
if: ${{ matrix.os == 'ubuntu-latest' && contains(matrix.features, 'lambda-rs/audio-output-device') }}
run: |
sudo apt-get update
sudo apt-get install -y \
libasound2-dev
- name: Configure Vulkan (Ubuntu)
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "WGPU_BACKEND=vulkan" >> "$GITHUB_ENV"
# Prefer Mesa's software Vulkan (lavapipe) to ensure headless availability
echo "VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json" >> "$GITHUB_ENV"
vulkaninfo --summary || true
# Windows runners already include the required toolchain for DX12 builds.
- name: Obtain rust toolchain for ${{ matrix.rustup-toolchain }}
run: |
rustup toolchain install ${{ matrix.rustup-toolchain }}
rustup default ${{ matrix.rustup-toolchain }}
- name: Check formatting
run: |
rustup component add rustfmt --toolchain nightly-2025-09-26
cargo +nightly-2025-09-26 fmt --all --check
- name: Build workspace
run: cargo build --workspace --features ${{ matrix.features }}
- name: Build examples (lambda-rs)
run: cargo build -p lambda-rs --examples --features ${{ matrix.features }}
- name: Test workspace
run: cargo test --workspace --features ${{ matrix.features }}
- uses: actions/setup-ruby@v1
- name: Send Webhook Notification for build status.
if: ${{ github.ref == 'refs/heads/main' }}
env:
JOB_STATUS: ${{ job.status }}
WEBHOOK_URL: ${{ secrets.LAMBDA_BUILD_WEBHOOK }}
HOOK_OS_NAME: ${{ runner.os }}
WORKFLOW_NAME: ${{ github.workflow }}
JOB_ID: ${{ github.job }}
run: |
git clone https://github.com/dhinakg/github-actions-discord-webhook.git webhook
bash webhook/send.sh $JOB_STATUS $WEBHOOK_URL
shell: bash