-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (71 loc) · 2.19 KB
/
Copy pathtest.yml
File metadata and controls
84 lines (71 loc) · 2.19 KB
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
name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main, development ]
jobs:
test:
runs-on: ${{ matrix.os }}
env:
PYTHONNET_RUNTIME: coreclr
strategy:
matrix:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Install NativeAOT dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y clang zlib1g-dev libkrb5-dev
- name: Publish NativeAOT lib
run: |
cd native/ThermoNativeReader
if [[ "${{ runner.os }}" == "macOS" ]]; then
ARCH=$(uname -m)
if [[ "$ARCH" == "arm64" ]]; then RID="osx-arm64"; else RID="osx-x64"; fi
LIB_FILE="ThermoNativeReader.dylib"
elif [[ "${{ runner.os }}" == "Linux" ]]; then
RID="linux-x64"
LIB_FILE="ThermoNativeReader.so"
else
RID="win-x64"
LIB_FILE="ThermoNativeReader.dll"
fi
dotnet publish -r $RID -c Release -p:PublishAot=true
echo "DYLIB_PATH=$(pwd)/bin/Release/net8.0/$RID/publish/$LIB_FILE" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: |
python -m venv .venv
source .venv/bin/activate
pip install maturin pytest numpy
pip install fisher-py
- name: Decompress test data
run: gunzip -d -k test_data/*.gz
- name: Build and test
run: |
source .venv/bin/activate
# Patch fisher-py
python .github/patch_fisher_py.py
# Copy native lib for bundling
cp ${{ env.DYLIB_PATH }} native_fisher_py/python/native_fisher_py/
# Install the package
cp README.md native_fisher_py/
cd native_fisher_py
maturin develop
cd ..
# Parity tests will automatically fall back to ground_truth.json if fisher-py fails
python -m pytest tests