sd/.github/workflows/test.yml
Danny Moesch 7724332232 Ignore integration tests in cross-compiled targets
As stated [here](https://github.com/rust-embedded/cross#supported-targets)
spawning threads in tests will make them fail or they may not terminate
at all.
2021-03-19 18:36:58 +01:00

65 lines
1.5 KiB
YAML

name: Test
on: [pull_request]
jobs:
test:
name: ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
use-cross: false
- os: ubuntu-latest
target: x86_64-unknown-linux-musl
use-cross: false
- os: ubuntu-latest
target: arm-unknown-linux-gnueabihf
use-cross: true
- os: windows-latest
target: x86_64-pc-windows-msvc
use-cross: false
- os: macos-latest
target: x86_64-apple-darwin
use-cross: false
- os: macos-latest
target: aarch64-apple-darwin
use-cross: true
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 1
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Create .cargo/config.toml
if: ${{ matrix.use-cross == true }}
shell: bash
run: |
mkdir .cargo
cat > .cargo/config.toml <<EOF
[target.${{ matrix.target }}]
rustflags = ["--cfg", "sd_cross_compile"]
EOF
- name: Test
uses: actions-rs/cargo@v1
with:
use-cross: ${{ matrix.use-cross }}
command: test
args: --target ${{ matrix.target }}