Fix cross-compilation #609
Workflow file for this run
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: Rust | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
fmt: | |
name: check rustfmt | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: rustfmt | |
- name: Format | |
run: cargo fmt --check | |
clippy: | |
name: check clippy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
- name: Clippy | |
run: cargo clippy -- -D warnings | |
tests: | |
strategy: | |
matrix: | |
include: | |
- os: ubuntu-latest | |
host_target: x86_64-unknown-linux-gnu | |
- os: macos-latest | |
host_target: x86_64-apple-darwin | |
- os: windows-latest | |
host_target: i686-pc-windows-msvc | |
runs-on: ${{ matrix.os }} | |
# Run tests under a directory with a space in it to double check the windows path heuristic | |
defaults: | |
run: | |
working-directory: "dir with spaces/ui test" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
path: "dir with spaces/ui test" | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: dtolnay/rust-toolchain@stable | |
if: ${{ matrix.os }} == ubuntu-latest | |
with: | |
targets: i686-unknown-linux-gnu, x86_64-unknown-linux-gnu | |
- name: Set up cross GCC | |
if: ${{ matrix.os }} == ubuntu-latest | |
run: sudo apt-get -y install gcc-i686-linux-gnu | |
- name: Build | |
run: cargo build --verbose | |
- name: Run ui tests | |
run: cargo test --verbose --test integration -- --check | |
- name: Run unit tests | |
run: cargo test --verbose | |
- name: Test cross target testing | |
env: | |
UITEST_TEST_TARGET: i686-unknown-linux-gnu | |
if: ${{ matrix.os }} == ubuntu-latest | |
run: cargo test --verbose |