name: CI
on:
push:
pull_request:
workflow_dispatch:
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
test:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, rust: stable }
- { os: macos-latest, rust: stable }
- { os: windows-latest, rust: stable }
- { os: ubuntu-latest, rust: '1.86.0' }
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install toolchain
run: rustup toolchain install ${{ matrix.rust }} --profile minimal --component clippy,rustfmt
- name: Select toolchain
run: rustup override set ${{ matrix.rust }}
- name: Fetch Rust dependencies
run: cargo fetch
- name: Check formatting
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: cargo fmt --all -- --check
- name: Test library, CLI, and examples
run: cargo test --all-targets --offline
- name: Test doctests
run: cargo test --doc --offline
- name: Clippy (pedantic)
run: cargo clippy --all-targets --offline -- -D warnings
- name: Documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo doc --no-deps --offline
- uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Check README diagram
run: python -c "from xml.etree import ElementTree as ET; ET.parse('assets/mathematical-conversion-map.svg')"
- name: Verify Cargo package
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: cargo package --offline
- name: Build CLI for interoperability checks
run: cargo build --offline
- name: Install Gmsh for MSH import gate
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: sudo apt-get update -qq && sudo apt-get install -y -qq gmsh
- name: Check MSH output with Gmsh
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
env:
CAEXFER_GMSH: gmsh
run: |
cargo test --lib formats::msh::interop_tests --offline
cargo test --test unv_interop --offline
- name: Check surface-to-Tet4 conversion quality with Gmsh
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: python scripts/check_tet_quality.py
- name: Execute independent CLI interoperability checks
run: python scripts/check_interop.py
- name: Check core conversion matrix
run: python scripts/check_matrix.py
- name: Install VTK for independent legacy-format checks
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: python -m pip install vtk==9.6.1
- name: Check legacy VTK with VTK reader and writer
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: python scripts/check_vtk.py
- name: Install pyNastran for OP2 interoperability
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: python -m pip install pyNastran==1.4.1
- name: Check OP2 conversion matrix
if: matrix.os == 'ubuntu-latest' && matrix.rust == 'stable'
run: python scripts/check_matrix.py --op2-check