name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- os: ubuntu-latest
- os: macos-latest
- os: windows-latest
steps:
- name: Install LLVM and Clang uses: KyleMayes/install-llvm-action@v1.9.0
if: matrix.config.os == 'windows-latest'
with:
version: "17"
directory: ${{ runner.temp }}/llvm
- name: Set LIBCLANG_PATH
run: echo "LIBCLANG_PATH=$((gcm clang).source -replace "clang.exe")" >> $env:GITHUB_ENV
if: matrix.config.os == 'windows-latest'
- uses: actions/checkout@v4
with:
submodules: recursive
- name: install dependencies
run: ./install-dependencies.sh
- name: Build
run: cargo build
- name: Run tests
run: cargo test
- name: Run tests with static CRT
if: matrix.config.os == 'windows-latest'
env:
RUSTFLAGS: -C target-feature=+crt-static
run: cargo test
- name: Build with system-installed HiGHS
if: matrix.config.os != 'windows-latest'
run: |
cd HiGHS
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build
sudo cmake --install build
cd ..
cargo clean
cargo build --no-default-features --features "discover"
wasm-emscripten:
runs-on: ubuntu-latest
env:
EMSDK_VERSION: 5.0.0
EMSDK_CACHE_FOLDER: emsdk-cache
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup emsdk
uses: pyodide/setup-emsdk@v15
with:
version: ${{ env.EMSDK_VERSION }}
actions-cache-folder: ${{ env.EMSDK_CACHE_FOLDER }}
- name: Build wasm32-unknown-emscripten
run: |
rustup target add wasm32-unknown-emscripten
cargo build --target wasm32-unknown-emscripten