wgpu/.github/workflows/ci.yml

174 lines
5.4 KiB
YAML
Raw Normal View History

2020-04-22 13:03:26 +00:00
name: CI
on:
push:
2021-05-11 19:00:41 +00:00
branches: [master, staging]
tags: [v0.*]
2020-04-22 13:03:26 +00:00
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
2021-07-04 02:10:10 +00:00
# Windows
- name: Windows x86_64
os: windows-2019
2020-04-22 13:03:26 +00:00
channel: stable
2021-07-04 02:10:10 +00:00
target: x86_64-pc-windows-msvc
2021-07-28 04:19:59 +00:00
kind: test
2021-07-04 02:10:10 +00:00
# MacOS
# Mac has no software runners, so don't run tests
- name: MacOS x86_64
os: macos-10.15
2021-07-04 02:10:10 +00:00
channel: stable
target: x86_64-apple-darwin
kind: compile
# IOS
- name: IOS aarch64
os: macos-10.15
2021-07-04 02:10:10 +00:00
channel: stable
target: aarch64-apple-ios
kind: compile
# Linux
- name: Linux x86_64
2021-06-17 05:03:47 +00:00
os: ubuntu-20.04
2020-04-22 13:03:26 +00:00
channel: stable
2021-07-04 02:10:10 +00:00
target: x86_64-unknown-linux-gnu
kind: test
- name: Linux Nightly x86_64
2021-06-17 05:03:47 +00:00
os: ubuntu-20.04
2020-04-22 13:03:26 +00:00
channel: nightly
2021-07-04 02:10:10 +00:00
target: x86_64-unknown-linux-gnu
kind: compile
# Android
- name: Android aarch64
os: ubuntu-20.04
2020-04-22 13:03:26 +00:00
channel: stable
2021-07-04 02:10:10 +00:00
target: aarch64-linux-android
kind: compile
# WebGPU/WebGL
- name: WebAssembly
os: ubuntu-20.04
channel: stable
target: wasm32-unknown-unknown
kind: webgl
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
PKG_CONFIG_ALLOW_CROSS: 1 # allow android to work
RUSTFLAGS: --cfg=web_sys_unstable_apis
2021-07-13 03:15:47 +00:00
RUSTDOCFLAGS: -Dwarnings
2021-07-04 02:10:10 +00:00
2020-04-22 13:03:26 +00:00
steps:
2021-07-04 02:10:10 +00:00
- name: checkout repo
uses: actions/checkout@v2
- name: install rust
2020-05-01 17:32:38 +00:00
uses: actions-rs/toolchain@v1
with:
2021-07-03 06:24:38 +00:00
toolchain: ${{ matrix.channel }}
2021-07-04 02:10:10 +00:00
target: ${{ matrix.target }}
2020-05-01 17:32:38 +00:00
override: true
2021-07-04 02:10:10 +00:00
profile: minimal
components: clippy
2021-07-03 06:24:38 +00:00
2021-07-04 02:10:10 +00:00
- name: add android apk to path
if: matrix.os == 'ubuntu-20.04' && matrix.target == 'aarch64-linux-android'
run: |
echo "$ANDROID_HOME/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
2021-07-03 06:24:38 +00:00
2021-07-04 02:10:10 +00:00
- name: install llvmpipe and lavapipe
if: matrix.os == 'ubuntu-20.04' && matrix.kind == 'test'
run: |
echo "Installing Vulkan"
sudo apt-get update -y -qq
sudo add-apt-repository ppa:ubuntu-x-swat/updates -y
sudo apt-get update
sudo apt install -y libxcb-xfixes0-dev mesa-vulkan-drivers
2021-07-03 06:24:38 +00:00
2021-07-04 02:10:10 +00:00
# This is separate for now because webgl isn't hooked up so we can't compile wgpu-core for wasm
- name: check web
if: matrix.kind == 'webgl'
run: |
cargo clippy --target ${{ matrix.target }} -p wgpu -- -D warnings
2021-07-03 06:24:38 +00:00
2021-07-13 03:15:47 +00:00
# build docs
cargo doc --target ${{ matrix.target }} -p wgpu --no-deps
2021-07-04 02:10:10 +00:00
- name: check native stable (fatal warnings)
if: (matrix.kind == 'compile' || matrix.kind == 'test') && matrix.channel == 'stable'
run: |
# check with no features
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-core -p wgpu-info -p player -- -D warnings
2021-07-03 06:24:38 +00:00
2021-07-04 02:10:10 +00:00
# check with all features
# explicitly don't mention wgpu-hal so that --all-features don't apply to it
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-core -p wgpu-info -p player --examples --tests --all-features -- -D warnings
2021-06-22 05:38:41 +00:00
2021-07-13 03:15:47 +00:00
# build docs
cargo doc --target ${{ matrix.target }} --no-deps
cargo doc --target ${{ matrix.target }} -p wgpu -p wgpu-core -p wgpu-info -p player --all-features --no-deps
2021-07-04 02:10:10 +00:00
- name: check native nightly (non-fatal warnings)
if: (matrix.kind == 'compile' || matrix.kind == 'test') && matrix.channel != 'stable'
run: |
# check with no features
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-core -p wgpu-info -p player
2021-03-12 17:39:04 +00:00
2021-07-04 02:10:10 +00:00
# check with all features
# explicitly don't mention wgpu-hal so that --all-features don't apply to it
cargo clippy --target ${{ matrix.target }} -p wgpu -p wgpu-core -p wgpu-info -p player --examples --tests --all-features
- name: build tests
if: matrix.kind == 'test'
run: |
cargo build --target ${{ matrix.target }} --bin wgpu-info
cargo build --target ${{ matrix.target }} --tests -p player
cargo build --target ${{ matrix.target }} --examples --tests -p wgpu
2021-07-28 04:19:59 +00:00
- name: tests
if: matrix.kind == 'test' && matrix.os == 'windows-2019'
run: |
# run wgpu-info
cargo run --target ${{ matrix.target }} --bin wgpu-info
2021-07-04 02:10:10 +00:00
2021-07-28 04:19:59 +00:00
# run player tests
cargo test --target ${{ matrix.target }} -p player -- --nocapture
2021-07-04 02:10:10 +00:00
2021-07-28 04:19:59 +00:00
# run coretests
2021-07-28 04:57:10 +00:00
cargo run --target ${{ matrix.target }} --bin wgpu-info -- cargo test --target ${{ matrix.target }} -p wgpu --no-fail-fast -- --nocapture --test-threads=1 # GLES is currently non-multithreadable
2021-07-04 02:10:10 +00:00
fmt:
name: Format
2021-03-12 17:39:04 +00:00
runs-on: ubuntu-latest
steps:
2021-07-04 02:10:10 +00:00
- name: checkout repo
uses: actions/checkout@v2
- name: install rust
uses: actions-rs/toolchain@v1
2021-03-12 17:39:04 +00:00
with:
profile: minimal
toolchain: stable
override: true
2021-07-04 02:10:10 +00:00
components: rustfmt
- name: run rustfmt
run: |
cargo fmt -- --check