surfman #7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main | |
on: | |
push: | |
pull_request: | |
branches: ["**"] | |
merge_group: | |
types: [checks_requested] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
Build: | |
name: ${{ format('{0} {1}', matrix.platform.target, matrix.features)}} | |
runs-on: ${{ matrix.platform.os }} | |
env: | |
RUST_BACKTRACE: 1 | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: | |
- { target: x86_64-pc-windows-msvc, os: windows-latest, test: true } | |
features: ["", "sm-raw-window-handle"] | |
include: | |
- features: "sm-angle-builtin" | |
platform: | |
{ target: x86_64-pc-windows-msvc, os: windows-latest, test: true } | |
- features: "sm-no-wgl sm-angle-builtin" | |
platform: | |
{ target: x86_64-pc-windows-msvc, os: windows-latest, test: true } | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies (Linux) | |
if: startsWith(matrix.platform.os, 'ubuntu') | |
run: | | |
sudo apt update | |
sudo apt install gcc libxxf86vm-dev libosmesa6-dev libgles2-mesa-dev xvfb weston -y | |
- name: Install rust | |
id: toolchain | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.platform.target }} | |
- name: Build | |
working-directory: surfman | |
run: | | |
cargo test --features "${{ matrix.features }}" | |
build_result: | |
name: Result | |
runs-on: ubuntu-24.04 | |
needs: ["Build"] | |
if: always() | |
steps: | |
- name: Mark the job as successful | |
if: ${{ !contains(needs.*.result, 'failure') && !contains(needs.*.result, 'cancelled') }} | |
run: exit 0 | |
- name: Mark the job as unsuccessful | |
if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') | |
run: exit 1 |