Fix feature gates (#9) #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref_name }}-${{ github.event.pull_request.number || github.sha }} | |
cancel-in-progress: true | |
jobs: | |
build-test: | |
name: ${{ matrix.os }}-capi=${{ matrix.capi }}-codec=${{ matrix.codec || 'all' }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false #${{ !( startsWith(github.ref, 'refs/heads/master') || startsWith(github.ref, 'refs/tags/') ) }} | |
matrix: | |
os: | |
- macos-14 # arm64 | |
- macos-13 # x86_64 | |
- windows-latest | |
- ubuntu-latest | |
capi: | |
- true | |
- false | |
codec: | |
- zstd | |
- blosc2 | |
- gzip | |
- brotli | |
- lz4 | |
- xz | |
- deflate | |
- bzip2 | |
- null # Use all codecs | |
# TODO: codecs not implemented in capi feature | |
exclude: | |
- capi: true | |
codec: blosc2 | |
- capi: true | |
codec: xz | |
- capi: true | |
codec: deflate | |
# TODO: capi feature fails with all enabled due to duplicate export of 'compress' symbol | |
# first from the capi here, then from blosc2 internal zlib-ng; probably just rename ours | |
# prefixed with 'cramjam_' or something. | |
- capi: true | |
codec: null | |
os: ubuntu-latest | |
- capi: true | |
codec: null | |
os: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Rust toolchain | |
uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
name: Rust Cache | |
- name: Audit | |
if: | | |
!matrix.codec && matrix.capi | |
run: cargo install cargo-audit && cargo audit | |
- name: Test capi and single codec | |
if: matrix.capi && matrix.codec | |
run: cargo test -p libcramjam --no-default-features --features ${{ matrix.codec }} --features capi --lib | |
- name: Test capi and all codecs | |
if: matrix.capi && !matrix.codec | |
run: cargo test -p libcramjam --features capi --lib | |
- name: Test no capi and all codecs | |
if: | | |
!matrix.capi && !matrix.codec | |
run: cargo test -p libcramjam --lib | |
- name: Test no capi and single codec | |
if: | | |
!matrix.capi && matrix.codec | |
run: cargo test -p libcramjam --lib --no-default-features --features ${{ matrix.codec }} |