-
Notifications
You must be signed in to change notification settings - Fork 6
91 lines (88 loc) · 3.85 KB
/
native_sanity.yml
File metadata and controls
91 lines (88 loc) · 3.85 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
85
86
87
88
89
90
91
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Native Sanity Checks
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
jobs:
native-build:
runs-on: ${{ matrix.os }}
timeout-minutes: 60
defaults:
run:
shell: bash -l {0}
working-directory: ./
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
python-version: ["3.10", "3.11", "3.12"]
numpy-version: [1.26]
build-config: ["Debug", "Release"]
steps:
- uses: actions/checkout@v4
with:
# Set fetch-depth to 0 so all history is retrieved; this is needed so we get the git tags
# which we use for setting the package version (via setuptools-scm).
fetch-depth: 0
- name: Setup Miniconda
env:
ACTIONS_ALLOW_UNSECURE_COMMANDS: "true"
uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: "conda_build"
python-version: ${{ matrix.python-version }}
miniforge-version: latest
use-mamba: true
auto-update-conda: true
channels: conda-forge
channel-priority: flexible
show-channel-urls: true
- name: Configure Conda
run: |
conda config --set unsatisfiable_hints_check_depth 0 # setting unsatisfiable_hints=False is broken
- name: Initializing Conda environment
run: |
python dev_tools/gen_requirements.py --out native_reqs.txt native
python dev_tools/gen_requirements.py --out runtime_reqs.txt runtime
python dev_tools/gen_requirements.py --out tests_reqs.txt tests
mamba create -q -y -n conda_build python=${{ matrix.python-version }} numpy=${{ matrix.numpy-version }} --file native_reqs.txt --file runtime_reqs.txt --file tests_reqs.txt
- name: Configure Linux
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
echo "CONFIG_SUBDIR=." >> $GITHUB_ENV
- name: Configure Windows
if: ${{ matrix.os == 'windows-latest' }}
run: |
echo "CONFIG_SUBDIR=${{ matrix.build-config }}" >> $GITHUB_ENV
- name: Setup CMake configuration
run: |
cmake -S . -B build "-DCMAKE_BUILD_TYPE=${{ matrix.build-config }}" "-DCMAKE_CONFIGURATION_TYPES=${{ matrix.build-config }}" "-DRIPTIDE_PYTHON_VER=${{ matrix.python-version }}" "-DCMAKE_VERBOSE_MAKEFILE=TRUE"
- name: Build via CMake
run: |
cmake --build build -j --config ${{ matrix.build-config }}
- name: Run the riptide tests
run: |
ctest --test-dir build -C ${{ matrix.build-config }} --output-on-failure -V -R "^riptide_test\..*"
- name: Run the riptide benchmarks
if: ${{ matrix.build-config == 'Release' }}
run: |
build/bench/riptide_bench/riptide_bench/${{ env.CONFIG_SUBDIR }}/riptide_bench
- name: Setup Python environment
run: |
# Set up to use the build riptide_cpp
echo "PYTHONPATH=$(pwd)/build/src/${{ env.CONFIG_SUBDIR }}" >> $GITHUB_ENV
- name: Verify riptide_cpp module
run: |
python -c "import riptide_cpp; print(riptide_cpp, riptide_cpp.__version__)"
- name: Install riptable
run: |
# Get just the latest riptable package
pip install -v --no-deps riptable
python -c "import riptable; print(riptable, riptable.__version__); print(riptable.rc, riptable.rc.__version__)"
- name: Run the riptide Python tests
run: |
echo "CONDA_PREFIX=${CONDA_PREFIX}"
PYTHONHOME=${CONDA_PREFIX} ctest --test-dir build -C ${{ matrix.build-config }} --output-on-failure -V -R "^riptide_python_test\..*"