-
Notifications
You must be signed in to change notification settings - Fork 2
146 lines (126 loc) · 5.15 KB
/
compile_lambda_rs.yml
File metadata and controls
146 lines (126 loc) · 5.15 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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
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
with:
lfs: true
- 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.
# The exact ICD filename can differ across Ubuntu images, so discover it.
LVP_ICD="$(
if [[ -d /usr/share/vulkan/icd.d ]]; then
find /usr/share/vulkan/icd.d -maxdepth 1 -type f \
\( -name '*lvp_icd*.json' -o -name '*lavapipe*.json' \) \
-print 2>/dev/null | head -n1
fi
)"
if [[ -z "$LVP_ICD" ]]; then
echo "lavapipe Vulkan ICD not found under /usr/share/vulkan/icd.d" >&2
ls -la /usr/share/vulkan/icd.d || true
else
echo "Using lavapipe ICD: $LVP_ICD"
echo "VK_ICD_FILENAMES=$LVP_ICD" >> "$GITHUB_ENV"
fi
echo "LAMBDA_REQUIRE_GPU_ADAPTER=1" >> "$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
if: ${{ contains(matrix.features, 'lambda-rs/audio-output-device') }}
run: cargo build --workspace --bins --features ${{ matrix.features }}
- name: Build workspace (exclude audio tools)
if: ${{ !contains(matrix.features, 'lambda-rs/audio-output-device') }}
run: |
cargo build --workspace \
--exclude lambda-audio-tool \
--exclude lambda-demos-audio \
--bins \
--features ${{ matrix.features }}
- name: Build examples (lambda-rs)
run: cargo build -p lambda-rs --examples --features ${{ matrix.features }}
- name: Test workspace
if: ${{ contains(matrix.features, 'lambda-rs/audio-output-device') }}
run: cargo test --workspace --features ${{ matrix.features }}
- name: Test workspace (exclude audio tools)
if: ${{ !contains(matrix.features, 'lambda-rs/audio-output-device') }}
run: |
cargo test --workspace \
--exclude lambda-audio-tool \
--exclude lambda-demos-audio \
--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