wgpu/.github/workflows/ci.yml
2021-06-02 21:31:02 -04:00

158 lines
4.9 KiB
YAML

name: CI
on:
push:
branches: [master, staging]
tags: [v0.*]
pull_request:
branches-ignore: [staging.tmp]
jobs:
ios_build:
name: iOS Stable
runs-on: macos-10.15
env:
TARGET: aarch64-apple-ios
steps:
- uses: actions/checkout@v2
- run: rustup component add clippy
- run: rustup target add ${{ env.TARGET }}
- run: cargo clippy --target ${{ env.TARGET }}
android_build:
name: Android Stable
runs-on: ubuntu-18.04
env:
TARGET: aarch64-linux-android
PKG_CONFIG_ALLOW_CROSS: 1
steps:
- uses: actions/checkout@v2
- run: echo "$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
- run: rustup component add clippy
- run: rustup target add ${{ env.TARGET }}
- run: cargo clippy --target ${{ env.TARGET }}
- name: Additional core features
run: cargo check --manifest-path wgpu-core/Cargo.toml --features trace --target ${{ env.TARGET }}
wasm:
name: Web Assembly
runs-on: ubuntu-18.04
env:
RUSTFLAGS: --cfg=web_sys_unstable_apis
steps:
- uses: actions/checkout@v2
- run: rustup target add wasm32-unknown-unknown
- name: Check WebGPU
run: cargo check --all-targets --target=wasm32-unknown-unknown
- name: Check WebGL
run: cargo check --all-targets --target=wasm32-unknown-unknown --features webgl
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-10.15, ubuntu-18.04, windows-2019]
channel: [stable, nightly]
include:
- name: MacOS Stable
channel: stable
os: macos-10.15
prepare_command:
additional_core_features: trace
additional_player_features: winit
- name: MacOS Nightly
os: macos-10.15
channel: nightly
prepare_command:
additional_core_features:
additional_player_features:
- name: Ubuntu Stable
os: ubuntu-18.04
channel: stable
prepare_command:
additional_core_features: trace,replay
additional_player_features:
- name: Ubuntu Nightly
os: ubuntu-18.04
channel: nightly
prepare_command: |
echo "Installing Vulkan"
sudo apt-get update -y -qq
sudo add-apt-repository ppa:kisak/kisak-mesa -y
sudo apt-get update
sudo apt install -y libxcb-xfixes0-dev mesa-vulkan-drivers
additional_core_features: serial-pass
additional_player_features: winit
- name: Windows Stable
os: windows-2019
channel: stable
prepare_command: rustup default stable-msvc
additional_core_features: trace,serial-pass
additional_player_features:
- name: Windows Nightly
os: windows-2019
channel: nightly
prepare_command: rustup default nightly-msvc
additional_core_features:
additional_player_features:
steps:
- uses: actions/checkout@v2
- if: matrix.channel == 'nightly'
name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
- if: matrix.channel == 'stable'
run: rustup component add clippy
# prepare
- if: matrix.prepare_command != ''
run: ${{ matrix.prepare_command }}
# build with no features first
- if: matrix.additional_core_features == ''
run: cargo check --manifest-path wgpu-core/Cargo.toml --no-default-features
- if: matrix.additional_core_features != ''
run: cargo check --manifest-path wgpu-core/Cargo.toml --features ${{ matrix.additional_core_features }}
- if: matrix.additional_player_features != ''
run: cargo check --manifest-path player/Cargo.toml --features ${{ matrix.additional_player_features }}
- if: matrix.channel == 'stable'
run: cargo clippy
- if: matrix.channel == 'nightly'
run: cargo test -- --nocapture
docs:
runs-on: [ubuntu-18.04]
steps:
- uses: actions/checkout@v2
- name: Install latest nightly
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
continue-on-error: true
- name: cargo doc
run: cargo --version; cargo doc --no-deps
continue-on-error: true
lint:
name: Clippy
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- run: rustup component add clippy
- uses: actions-rs/cargo@v1
with:
command: clippy
args: -- -D warnings
- uses: actions-rs/cargo@v1
with:
command: fmt
args: -- --check