-
Notifications
You must be signed in to change notification settings - Fork 6
87 lines (78 loc) · 2.41 KB
/
macos_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
# NOTE: these tests do not run the C++
# test suite. We don't do these tests
# b/c boost from brew has proven tricky
# to work with here.
name: macOS_CI
on:
pull_request:
jobs:
test_macos:
name: macOS_CI
runs-on: ${{ matrix.os }}
strategy:
matrix:
python: [ "3.11", "3.12" ]
os: [ macos-14, macos-13 ]
rust: [1.62.1]
defaults:
run:
shell: bash
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.12.1
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
- name: Install cbindgen
uses: baptiste0928/cargo-install@v3
with:
crate: cbindgen
version: "=0.24.3"
locked: true
cache-key: ${{ matrix.os }}
- name: Install GSL
run: |
brew install gsl
- name: Install Python dependencies
run: |
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install wheel
python -m pip install -r requirements/development.txt
- name: Build extension module
run: |
source venv/bin/activate
cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release -DBUILD_PYTHON_UNIT_TESTS=ON -DDISABLE_LTO=ON
cmake --build build -j 4
- name: Manualy run setuptools_scm
run: |
source venv/bin/activate
python -m setuptools_scm
- name: Run Python tests
run: |
source venv/bin/activate
python -m pytest -n 4 tests
python -m pytest -n 2 tests_with_cpp
- name: Clean up build and venv
run: |
rm -rf build venv
- name: Test pip install from dist in fresh venv
run: |
python -m pip install build
python -m build -o dist -w .
cd dist
python -m venv venv
source venv/bin/activate
which python
python -m pip install --no-cache-dir ./fwdpy11*.whl
python -m fwdpy11 --includes
python -c "import fwdpy11;print(fwdpy11.__version__)"
python -c "import fwdpy11;print(fwdpy11.__file__)"