name: Tests Suite
on:
workflow_dispatch:
pull_request:
branches: [ main ]
push:
branches: [ main ]
jobs:
test:
name: Test Suite
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
arch: [x86, x64]
include:
- os: ubuntu-latest
arch: x86
rust_target: i686-unknown-linux-gnu
- os: ubuntu-latest
arch: x64
rust_target: x86_64-unknown-linux-gnu
- os: windows-latest
arch: x86
rust_target: i686-pc-windows-msvc
- os: windows-latest
arch: x64
rust_target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@dev
- name: Install Rust target
run: rustup target add ${{ matrix.rust_target }}
- name: Install Linux x86 Dependencies
if: matrix.os == 'ubuntu-latest' && matrix.arch == 'x86'
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y gcc-multilib g++-multilib
- name: Run xmake package tests
run: |
cargo test --package xmake
cargo test --doc
- name: Find and run test binaries
shell: bash
run: |
find tests -type f -name "Cargo.toml" | while read -r cargo_toml; do
crate_dir=$(dirname "$cargo_toml")
crate_name=$(basename "$crate_dir")
cargo run -p "$crate_name" --target ${{ matrix.rust_target }}
done