Skip to content

CI

CI #72

Workflow file for this run

name: CI
on:
push:
branches:
- '**'
tags:
- '!v*' # Exclude tags starting with 'v'
pull_request:
schedule:
- cron: '0 0 * * 0' # Run weekly (every Sunday night at midnight UTC)
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: Test
runs-on: ${{ matrix.target.os }}
strategy:
fail-fast: false
matrix:
target:
- os: ubuntu-latest
triple: x86_64-unknown-linux-gnu
- os: macos-latest
triple: x86_64-apple-darwin
- os: windows-latest
triple: x86_64-pc-windows-msvc
features: [ 'build-assimp', 'static-link', '' ]
exclude:
# TODO: Fix static linking on Windows
- target:
os: windows-latest
features: ''
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
# LLVM comes preinstalled on Windows and macOS runners
- name: Install LLVM
if: runner.os == 'Linux'
uses: KyleMayes/install-llvm-action@v1
with:
directory: ${{ runner.temp }}/llvm
cached: true
version: '14.0'
# CMake and Rust are preinstalled on all runners.
- name: Update Rust
run: |
rustup update stable
rustup target add ${{ matrix.target.triple }}
- name: Cache Rust
uses: Swatinem/rust-cache@v2
# No build features enabled, make sure it works with assimp
# installed on the system via package manager.
- name: Install dependencies
if: matrix.features == ''
shell: bash
run: |
if [ "$RUNNER_OS" == 'Linux' ]; then
# Install on Ubuntu
# https://github.com/assimp/assimp/blob/master/Build.md#install-on-ubuntu
sudo apt-get update
sudo apt-get install libassimp-dev
elif [ "$RUNNER_OS" == 'macOS' ]; then
brew install assimp
elif [ "$RUNNER_OS" == 'Windows' ]; then
vcpkg install assimp
else
echo "Unsupported OS: $RUNNER_OS"
exit 1
fi
- name: Build
run: cargo build --target ${{ matrix.target.triple }} --features '${{ matrix.features }}'
- name: Test
run: cargo test --target ${{ matrix.target.triple }} --features '${{ matrix.features }}'