Skip to content

Commit

Permalink
tidy up - see if it works
Browse files Browse the repository at this point in the history
  • Loading branch information
milesgranger committed Apr 13, 2024
1 parent 48a14ec commit fc94b59
Showing 1 changed file with 17 additions and 24 deletions.
41 changes: 17 additions & 24 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ jobs:
uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
name: Rust Cache
with:
prefix-key: ${{ matrix.conf.os }}-${{ matrix.conf.manylinux }}-${{ matrix.conf.target-triple }}-${{ matrix.conf.python-architecture }}-${{ matrix.package.name }}-

Expand Down Expand Up @@ -169,42 +170,34 @@ jobs:
- name: Setup (Ubuntu)
if: runner.os == 'Linux'
env:
TARGET_TRIPLE: ${{ matrix.conf.target-triple }}
WORKSPACE: ${{ github.workspace }}
BLOSC2_INSTALL_PREFIX: ${{ github.workspace }}/blosc2
run: |
sudo apt update
sudo apt install ninja-build -y
echo "BLOSC2_INSTALL_PREFIX=${{ github.workspace }}/blosc2" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${{ github.workspace }}/blosc2/lib:${{ github.workspace }}/blosc2/lib64" >> $GITHUB_ENV
echo "BLOSC2_INSTALL_PREFIX=$BLOSC2_INSTALL_PREFIX" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BLOSC2_INSTALL_PREFIX/lib:$BLOSC2_INSTALL_PREFIX/lib64" >> $GITHUB_ENV
- name: Set up Clang (Ubuntu)
if: runner.os == 'Linux'
uses: egor-tensin/setup-clang@v1
with:
version: 17
# maturin action fails building blosc2 for armv7 and aarch64
# so we'll just use 'cross' to build and pass it in for the action for all archs
# nothing special for the revision pin, just deterministic install
cargo install cross --git https://github.com/cross-rs/cross --rev 6d097fb
cross build --release --target $TARGET_TRIPLE --package blosc2-sys --target-dir build
blosc2_sys_dir=$(ls build/$TARGET_TRIPLE/release/build/ | grep blosc2-sys)
mv $WORKSPACE/build/$TARGET_TRIPLE/release/build/$blosc2_sys_dir/out $BLOSC2_INSTALL_PREFIX
ls $BLOSC2_INSTALL_PREFIX | tree
- name: Audit
if: runner.os == 'Linux'
if: runner.os == 'Linux' && matrix.conf.target == 'x86_64'
run: cargo install cargo-audit && cargo audit

- name: Rust Tests
if: matrix.conf.target == 'x86_64' && !startsWith(matrix.python-version, 'pypy')
run: cargo test --no-default-features --release --lib

# maturin action fails building blosc2 for armv7 and aarch64
# so we'll just use 'cross' to build and pass it in for the action for all archs
- name: Build blosc2 (Linux)
if: runner.os == 'Linux'
env:
TARGET_TRIPLE: ${{ matrix.conf.target-triple }}
WORKSPACE: ${{ github.workspace }}
run: |
cargo install cross --git https://github.com/cross-rs/cross --rev 6d097fb
cross build --release --target $TARGET_TRIPLE --package blosc2-sys --target-dir build
blosc2_sys_dir=$(ls build/$TARGET_TRIPLE/release/build/ | grep blosc2-sys)
mv $WORKSPACE/build/$TARGET_TRIPLE/release/build/$blosc2_sys_dir/out $BLOSC2_INSTALL_PREFIX
ls -l $BLOSC2_INSTALL_PREFIX
- name: Build wheel (Linux)
if: runner.os == 'Linux'
uses: PyO3/maturin-action@v1
Expand All @@ -213,7 +206,7 @@ jobs:
manylinux: ${{ matrix.conf.manylinux }}
docker-options: -e BLOSC2_INSTALL_PREFIX=${{ github.workspace }}/blosc2
args: -i ${{ matrix.python-version }} --release --out dist --manifest-path ${{ matrix.package.dir }}/Cargo.toml --features use-system-blosc2 --features blosc2-static
before-script-linux: ls -lhs $BLOSC2_INSTALL_PREFIX
before-script-linux: ls $BLOSC2_INSTALL_PREFIX | tree

- name: Build wheel (Windows)
if: runner.os == 'Windows'
Expand Down

0 comments on commit fc94b59

Please sign in to comment.