1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
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: Install nasm
if: runner.os != 'macOS'
uses: ilammy/setup-nasm@v1
- name: Install build deps (OSX)
if: runner.os == 'macOS'
run: brew install automake autoconf coreutils libtool nasm
- name: Set MSVC developer prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1.6.0
- 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 }}
# build-wasm32:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - name: Install Rust toolchain
# uses: dtolnay/rust-toolchain@stable
# with:
# target: wasm32-unknown-emscripten
# - name: Install Emscripten
# uses: mymindstorm/setup-emsdk@v14
# - name: Build
# run: cargo build --target wasm32-unknown-emscripten --features wasm32-compat