-
Notifications
You must be signed in to change notification settings - Fork 48
93 lines (93 loc) · 3.07 KB
/
test.yaml
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
name: test
on:
pull_request:
push:
branches:
- master
- release/*
defaults:
run:
shell: bash
env:
official_container_repository: ghcr.io/evalf/nutils
jobs:
build-python-package:
name: Build Python package
runs-on: ubuntu-latest
outputs:
wheel: ${{ steps.build.outputs.wheel }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install build dependencies
run: python3 -m pip install flit
- name: Build package
id: build
run: |
# To make the wheels reproducible, set the timestamp of the (files in
# the) generated wheels to the date of the commit.
export SOURCE_DATE_EPOCH=`git show -s --format=%ct`
python3 -m flit build
echo wheel=`echo dist/*.whl` >> $GITHUB_OUTPUT
- name: Upload package artifacts
uses: actions/upload-artifact@v4
with:
name: python-package
path: dist/
if-no-files-found: error
test:
needs: build-python-package
name: 'Test ${{ matrix.name }}'
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- {name: "python 3.11", os: ubuntu-latest, python-version: "3.11", matrix-backend: numpy, nprocs: 1}
fail-fast: false
env:
_wheel: ${{ needs.build-python-package.outputs.wheel }}
NUTILS_MATRIX: ${{ matrix.matrix-backend }}
NUTILS_NPROCS: ${{ matrix.nprocs }}
NUTILS_DEBUG: all
OMP_NUM_THREADS: 1
VECLIB_MAXIMUM_THREADS: 1
MKL_DYNAMIC: FALSE
MKL_NUM_THREADS: 1
PYTHONHASHSEED: 0
NUTILS_TENSORIAL: ${{ matrix.tensorial }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Move nutils directory
run: mv nutils _nutils
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download Python package artifact
uses: actions/download-artifact@v4
with:
name: python-package
path: dist/
- name: Install Graphviz
if: ${{ matrix.os == 'ubuntu-latest' }}
run: sudo apt install -y graphviz
- name: Install Nutils and dependencies
id: install
env:
_numpy_version: ${{ matrix.numpy-version }}
run: |
python -um pip install --upgrade --upgrade-strategy eager wheel
python -um pip install --upgrade --upgrade-strategy eager coverage numpy$_numpy_version
# Install Nutils from `dist` dir created in job `build-python-package`.
python -um pip install "$_wheel[import_gmsh,export_mpl]"
- name: Install Scipy
if: ${{ matrix.matrix-backend == 'scipy' }}
run: python -um pip install --upgrade scipy
- name: Configure MKL
if: ${{ matrix.matrix-backend == 'mkl' }}
run: |
python -um pip install --upgrade --upgrade-strategy eager 'mkl<2024'
python -um devtools.gha.configure_mkl
- name: Test
run: python -m unittest tests.test_evaluable.log_error