-
Notifications
You must be signed in to change notification settings - Fork 4
88 lines (82 loc) · 3.02 KB
/
test.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
name: Test
on:
push: { branches: [ "master" ] }
pull_request: { branches: [ "master" ] }
concurrency:
group: test-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-22.04
strategy:
matrix:
include:
- optionals: "sage"
sagelib: "10.0"
python: "3.10"
- optionals: "sage,sage_flatsurf,pyeantic,pyintervalxt,pyflatsurf,pynormaliz,surface_dynamics"
sagelib: "10.3"
python: "3.10"
# Test optional dependencies in isolation
- optionals: "sage"
sagelib: "10.3"
python: "3.10"
# Recent sage-flatsurf depends on surface-dynamics
- optionals: "sage,surface_dynamics,sage_flatsurf"
sagelib: "10.3"
python: "3.10"
- optionals: "sage,pyeantic"
sagelib: "10.3"
python: "3.10"
- optionals: "sage,pyintervalxt"
sagelib: "10.3"
python: "3.10"
- optionals: "sage,pynormaliz"
sagelib: "10.3"
python: "3.10"
- optionals: "sage,surface_dynamics"
sagelib: "10.3"
python: "3.10"
- optionals: "sage,pyflatsurf"
sagelib: "10.3"
python: "3.10"
steps:
- uses: actions/checkout@v2
with: { submodules: recursive }
- uses: conda-incubator/setup-miniconda@v2
with: { miniforge-variant: "Mambaforge", miniforge-version: "latest", python-version: "${{ matrix.python }}" }
- name: Install dependencies
shell: bash -l {0}
run: |
if (echo "${{ matrix.optionals }}" | grep sage); then
mamba install -n test sagelib=${{ matrix.sagelib }}
echo "sagelib ==${{ matrix.sagelib }}" >> $CONDA_PREFIX/conda-meta/pinned
fi
while read; do
optional=$(echo "$REPLY" | grep -o '# optional: [^ ]*' | awk '{ print $3; }') || true
(test "$optional" == '' || (echo "${{ matrix.optionals }}" | grep -E '\b'"$optional"'\b') > /dev/null) && echo "$REPLY" || true
done < environment.yml > environment.test.yml
mamba env update --quiet -n test -f environment.test.yml
conda list
- name: Install veerer
shell: bash -l {0}
run: |
pip install --verbose --no-index .
# Show message about cppyy regenerating pre-compiled headers so it does not show during the tests
python -c 'import cppyy' || true
- name: Run SageMath doctests
shell: bash -l {0}
run: |
mamba remove -y pytest # sage -t breaks in some old versions of SageMath if pytest is installed
sage -tp --force-lib --long --optional=${{ matrix.optionals }} veerer doc
- name: Run pytest
shell: bash -l {0}
working-directory: tests
run: |
mamba install -y pytest pytest-xdist
pytest -n auto
- uses: flatsurf/actions/show-logs@main
if: ${{ always() }}
env:
MAKEFLAGS: -j2
SAGE_NUM_THREADS: 2