Skip to content

Commit 1e8e13e

Browse files
committed
try
Signed-off-by: sagudev <16504129+sagudev@users.noreply.github.com>
1 parent 1714136 commit 1e8e13e

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.github/workflows/main.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: Main
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: ["**"]
7+
merge_group:
8+
types: [checks_requested]
9+
10+
env:
11+
CARGO_TERM_COLOR: always
12+
13+
jobs:
14+
Build:
15+
name: ${{ format('{0} {1}', matrix.platform.target, matrix.features)}}
16+
runs-on: ${{ matrix.platform.os }}
17+
env:
18+
RUST_BACKTRACE: 1
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
platform:
23+
- { target: x86_64-pc-windows-msvc, os: windows-latest, test: true }
24+
- { target: i686-pc-windows-msvc, os: windows-latest, test: false }
25+
- { target: aarch64-pc-windows-msvc, os: windows-latest, test: false }
26+
features:
27+
[
28+
"",
29+
"chains sm-raw-window-handle-06",
30+
"chains sm-raw-window-handle-05",
31+
]
32+
include:
33+
- features: "chains sm-angle-builtin"
34+
platform:
35+
{ target: x86_64-pc-windows-msvc, os: windows-latest, test: true }
36+
- features: "chains sm-no-wgl sm-angle-builtin"
37+
platform:
38+
{ target: x86_64-pc-windows-msvc, os: windows-latest, test: true }
39+
steps:
40+
- uses: actions/checkout@v4
41+
- name: Install dependencies (Linux)
42+
if: startsWith(matrix.platform.os, 'ubuntu')
43+
run: |
44+
sudo apt update
45+
sudo apt install gcc libxxf86vm-dev libosmesa6-dev libgles2-mesa-dev xvfb weston -y
46+
- name: Install rust
47+
id: toolchain
48+
uses: dtolnay/rust-toolchain@stable
49+
with:
50+
targets: ${{ matrix.platform.target }}
51+
- name: Build
52+
run: |
53+
rustup target add ${{ matrix.platform.target }}
54+
cargo build --features "${{ matrix.features }}" --target ${{ matrix.platform.target }}
55+
- name: Test
56+
if: ${{ matrix.platform.test && startsWith(matrix.platform.os, 'ubuntu') }}
57+
run: |
58+
weston --no-config --socket=wl-test-env --backend=headless &
59+
WAYLAND_DISPLAY=wl-test-env xvfb-run cargo test --features "${{ matrix.features }}" --target ${{ matrix.platform.target }}
60+
- name: Test
61+
if: ${{ matrix.platform.test && !startsWith(matrix.platform.os, 'ubuntu') }}
62+
run: |
63+
cargo test --features "${{ matrix.features }}" --target ${{ matrix.platform.target }}
64+
build_result:
65+
name: Result
66+
runs-on: ubuntu-24.04
67+
needs: ["Build"]
68+
if: always()
69+
steps:
70+
- name: Mark the job as successful
71+
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }}
72+
run: exit 0
73+
- name: Mark the job as unsuccessful
74+
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')
75+
run: exit 1

0 commit comments

Comments
 (0)