Skip to content

Add native builds, static feature and BLOSC2_INSTALL_PREFIX #101

Add native builds, static feature and BLOSC2_INSTALL_PREFIX

Add native builds, static feature and BLOSC2_INSTALL_PREFIX #101

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
release:
types:
- released
- prereleased
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-13 # x86_64
- macos-14 # M1
- windows-latest
- ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install packages (macOS)
if: runner.os == 'macOS'
run: |
echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV
brew install ninja
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install packages (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt update
sudo apt install build-essential ninja-build -y
- uses: rui314/setup-mold@v1
- name: Set Env
shell: bash
# Cannot set dynamic link path from build.rs
# xref: https://github.com/rust-lang/cargo/issues/4895
run: |
echo "BLOSC2_INSTALL_PREFIX=$(pwd)/build" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$BLOSC2_INSTALL_PREFIX/lib64:$BLOSC2_INSTALL_PREFIX/lib" >> $GITHUB_ENV
echo "DYLD_FALLBACK_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Test
shell: bash
run: cargo test