Merge pull request #141 from rust-windowing/release-0.3.1 #296
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: CI | |
on: | |
pull_request: | |
push: | |
branches: [master] | |
jobs: | |
Check_Formatting: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: stable | |
components: rustfmt | |
- name: Check Formatting | |
run: cargo +stable fmt --all -- --check | |
miri-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: nightly | |
components: miri | |
- name: Run tests with miri | |
run: cargo +nightly miri test | |
tests: | |
name: Tests | |
strategy: | |
fail-fast: false | |
matrix: | |
rust_version: ['1.64.0', stable, nightly] | |
platform: | |
- { target: x86_64-pc-windows-msvc, os: windows-latest, } | |
- { target: i686-pc-windows-msvc, os: windows-latest, } | |
# TODO: wait for https://github.com/microsoft/windows-rs/issues/2614#issuecomment-1684152597 | |
# to be resolved before re-enabling these | |
# - { target: x86_64-pc-windows-gnu, os: windows-latest, host: -x86_64-pc-windows-gnu } | |
# - { target: i686-pc-windows-gnu, os: windows-latest, host: -i686-pc-windows-gnu } | |
- { target: i686-unknown-linux-gnu, os: ubuntu-latest, } | |
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, } | |
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "x11,x11-dlopen" } | |
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "wayland,wayland-dlopen" } | |
- { target: x86_64-unknown-linux-gnu, os: ubuntu-latest, options: --no-default-features, features: "kms" } | |
- { target: x86_64-unknown-redox, os: ubuntu-latest, } | |
- { target: x86_64-unknown-freebsd, os: ubuntu-latest, } | |
- { target: x86_64-unknown-netbsd, os: ubuntu-latest, options: --no-default-features, features: "x11,x11-dlopen,wayland,wayland-dlopen" } | |
- { target: x86_64-apple-darwin, os: macos-latest, } | |
- { target: wasm32-unknown-unknown, os: ubuntu-latest, } | |
include: | |
- rust_version: nightly | |
platform: { target: wasm32-unknown-unknown, os: ubuntu-latest, options: "-Zbuild-std=panic_abort,std", rustflags: "-Ctarget-feature=+atomics,+bulk-memory" } | |
env: | |
RUST_BACKTRACE: 1 | |
CARGO_INCREMENTAL: 0 | |
RUSTFLAGS: "-C debuginfo=0 --deny warnings ${{ matrix.platform.rustflags }}" | |
OPTIONS: ${{ matrix.platform.options }} | |
FEATURES: ${{ format(',{0}', matrix.platform.features ) }} | |
CMD: ${{ matrix.platform.cmd }} | |
RUSTDOCFLAGS: -Dwarnings | |
runs-on: ${{ matrix.platform.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: taiki-e/install-action@v2 | |
if: matrix.platform.target == 'wasm32-unknown-unknown' | |
with: | |
tool: wasm-bindgen-cli | |
- uses: hecrj/setup-rust-action@v1 | |
with: | |
rust-version: ${{ matrix.rust_version }}${{ matrix.platform.host }} | |
targets: ${{ matrix.platform.target }} | |
components: clippy, rust-src | |
- name: Install GCC Multilib | |
if: (matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686') | |
run: sudo apt-get update && sudo apt-get install gcc-multilib | |
- name: Build crate | |
shell: bash | |
run: cargo $CMD build --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES | |
- name: Build tests | |
shell: bash | |
if: > | |
!((matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')) && | |
!contains(matrix.platform.target, 'redox') && | |
!contains(matrix.platform.target, 'freebsd') && | |
!contains(matrix.platform.target, 'netbsd') && | |
matrix.rust_version != '1.64.0' | |
run: cargo $CMD test --no-run --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES | |
- name: Run tests | |
shell: bash | |
if: > | |
!((matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')) && | |
!contains(matrix.platform.target, 'redox') && | |
!contains(matrix.platform.target, 'freebsd') && | |
!contains(matrix.platform.target, 'netbsd') && | |
!contains(matrix.platform.target, 'linux') | |
run: cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES | |
# TODO: We should also be using Wayland for testing here. | |
- name: Run tests using Xvfb | |
shell: bash | |
if: > | |
!((matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')) && | |
!contains(matrix.platform.target, 'redox') && | |
!contains(matrix.platform.target, 'freebsd') && | |
!contains(matrix.platform.target, 'netbsd') && | |
contains(matrix.platform.target, 'linux') && | |
!contains(matrix.platform.options, '--no-default-features') && | |
!contains(matrix.platform.features, 'wayland') | |
run: xvfb-run cargo $CMD test --verbose --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES | |
- name: Lint with clippy | |
shell: bash | |
if: > | |
(matrix.rust_version == 'stable') && | |
!contains(matrix.platform.options, '--no-default-features') && | |
!((matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')) && | |
!contains(matrix.platform.target, 'redox') && | |
!contains(matrix.platform.target, 'freebsd') && | |
!contains(matrix.platform.target, 'netbsd') | |
run: cargo clippy --all-targets --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES -- -Dwarnings | |
- name: Lint with rustdoc | |
shell: bash | |
if: > | |
(matrix.rust_version == 'stable') && | |
!contains(matrix.platform.options, '--no-default-features') && | |
!((matrix.platform.os == 'ubuntu-latest') && contains(matrix.platform.target, 'i686')) && | |
!contains(matrix.platform.target, 'redox') && | |
!contains(matrix.platform.target, 'freebsd') && | |
!contains(matrix.platform.target, 'netbsd') | |
run: cargo doc --no-deps --target ${{ matrix.platform.target }} $OPTIONS --features $FEATURES --document-private-items |