CI: run cargo test (enable doc-tests, etc.) #876
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: Check | |
on: | |
- push | |
- pull_request | |
env: | |
CARGO_NET_RETRY: 10 | |
CI: 1 | |
RUSTUP_MAX_RETRIES: 10 | |
jobs: | |
build: | |
name: CI (Ubuntu) | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
target: | |
- x86_64-unknown-linux-gnu | |
- x86_64-pc-windows-gnu | |
- i686-unknown-linux-gnu | |
- wasm32-unknown-unknown | |
env: | |
CARGO_BUILD_TARGET: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
run: | | |
rustup toolchain install nightly --target ${{ matrix.target }} --profile default --component clippy | |
- name: Install node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 21 | |
- name: Install System packages | |
run: | | |
sudo apt update | |
sudo apt install gcc-multilib nasm mingw-w64 gcc-mingw-w64 | |
rustup component add rust-src --toolchain nightly-x86_64-unknown-linux-gnu | |
python -m pip install pefile | |
- name: Clippy | |
run: cargo clippy --all-targets -- -D warnings -A clippy::missing_safety_doc | |
- name: Rustfmt | |
run: cargo fmt --check --all | |
- name: Test | |
if: ${{ matrix.target != 'wasm32-unknown-unknown' && matrix.target != 'x86_64-pc-windows-gnu' }} | |
run: cargo test --no-fail-fast -- --test-threads 1 | |
- name: Check cargo build | |
if: ${{ matrix.target != 'wasm32-unknown-unknown' && matrix.target != 'x86_64-pc-windows-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} _ CargoDev 0 ./tests/ci-dev.json | |
- name: Check cargo build --release | |
if: ${{ matrix.target != 'wasm32-unknown-unknown' && matrix.target != 'x86_64-pc-windows-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} _ CargoRelease 0 ./tests/ci.json | |
- name: Check C (x86_64) | |
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./release.sh C 64 ./tests/ci.json | |
- name: Check C (x86_64) - short | |
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./.github/workflows/release-short.sh C 64 ./tests/ci.json | |
- name: Check C (x86_64) - MinGW64 | |
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./release-64bit-mingw.sh C 64 ./tests/ci.json | |
- name: Check C (x86) | |
if: ${{ matrix.target == 'i686-unknown-linux-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./release-32bit.sh C 32 ./tests/ci.json | |
- name: Check Rust (x86_64) | |
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./release-rs.sh Rust 64 ./tests/ci.json | |
- name: Check Rust (x86_64) - short | |
if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./.github/workflows/release-rs-short.sh Rust 64 ./tests/ci.json | |
- name: Check Rust (x86_64) - MinGW64 | |
if: ${{ matrix.target == 'x86_64-pc-windows-gnu' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./release-rs-mingw.sh Rust 64 ./tests/ci.json | |
- name: Check wasm32 | |
if: ${{ matrix.target == 'wasm32-unknown-unknown' }} | |
run: | | |
python ./scripts/ci.py ${{ runner.temp }} ./release-wasm32.sh JavaScript 32 ./tests/ci.json |