-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (119 loc) · 3.78 KB
/
CI.yml
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: CI
on:
pull_request:
push:
branches:
- main
release:
types:
- released
- prereleased
jobs:
test-conda-env:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os:
- macos-14
- windows-latest
- ubuntu-latest
flags:
- --features use-system-blosc2
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.12
mamba-version: "*"
channels: conda-forge,defaults
channel-priority: true
activate-environment: blosc2
environment-file: environment.yml
- shell: bash -el {0}
run: |
conda info
conda list
conda config --show-sources
conda config --show
printenv | sort
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install packages (macOS)
if: runner.os == 'macOS'
run: brew install ninja
- name: Install packages (Windows)
if: runner.os == 'Windows'
run: choco install ninja
- name: Install packages (Ubuntu)
if: runner.os == 'Linux'
shell: bash -el {0}
run: conda install clang -y
- name: Build
shell: bash -el {0}
run: cargo build ${{ matrix.flags }} --release
- name: Test
# Running tests using shared library is ugly since conda doesn't
# update LD_LIBRARY_PATH type env vars, so would manually need to
# set the library to a currently discoverable place or update these
# env vars for each platform. Won't automatically locate the blosc2
# shared library within the conda environment.
if: ${{ matrix.flags == '--features static' }}
shell: bash -el {0}
run: cargo test ${{ matrix.flags }} --release
test-cross:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- x86_64-unknown-linux-musl
- s390x-unknown-linux-gnu
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Install cross
run: cargo install cross --git https://github.com/cross-rs/cross --rev 6d097fb
- name: Test
run: cross test --target ${{ matrix.target }} --no-default-features --features static --release
test-native:
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@v4
with:
submodules: recursive
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Set Environment Variables
if: runner.os == 'macOS'
run: |
# echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=10.12" >> $GITHUB_ENV
# Known issue where testing w/ shared linked lib doesn't work with --doc testing
- name: Test (shared)
run: cargo test --features shared --lib -vv --release
- name: Test (static)
run: |
cargo clean # ensure we're starting fresh, no funny business
cargo test --no-default-features --features static -vv --release
- name: Run examples
shell: bash
run: |
for example in $(find examples -name '*.rs'); do
example_name=$(basename $example .rs)
echo "------- Running example: ${example_name} -------"
cargo run --example $example_name
done