-
Notifications
You must be signed in to change notification settings - Fork 24
133 lines (108 loc) · 3.64 KB
/
testing.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Tests
on:
push:
pull_request:
jobs:
build:
env:
DISPLAY: ":99.0" # arbitrary
# GSETTINGS_SCHEMA_DIR_CONDA_BACKUP is somehow related to the following issue https://github.com/conda/conda/issues/9966
GSETTINGS_SCHEMA_DIR_CONDA_BACKUP: "/usr/share/miniconda/envs/testenv/share/glib-2.0/schemas"
strategy:
matrix:
host-os: ["ubuntu-latest", "macos-latest", "windows-latest"]
python-version: ["3.9", "3.10", "3.11"]
numpy-version: ["1.26"]
pyqt-version: ["5.15"]
include:
- host-os: "ubuntu-latest"
conda-mamba: "mamba"
- host-os: "macos-latest"
conda-mamba: "mamba"
- host-os: "windows-latest"
conda-mamba: "mamba"
fail-fast: false
runs-on: ${{ matrix.host-os }}
# Note: Services are based on docker containers and would run only on Linux
# Leave the item here for reference.
# services:
# mongodb:
# image: mongo
# ports:
# - 27017:27017
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
# This step is not expected to influence the test, since the test is run in Conda environment
python-version: 3.9
- uses: conda-incubator/setup-miniconda@v2
with:
# miniforge-variant: Mambaforge
miniforge-version: latest
channels: conda-forge
channel-priority: flexible
auto-update-conda: true
show-channel-urls: true
allow-softlinks: true
auto-activate-base: false
activate-environment: testenv
use-only-tar-bz2: false
- name: Install Linux libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb herbstluftwm
- name: Start 'xvfb'
if: runner.os == 'Linux'
run: |
sudo /sbin/start-stop-daemon --start --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
sleep 3
- name: Start 'herbstluftwm'
if: runner.os == 'Linux'
run: |
herbstluftwm &
sleep 1
- name: Install Conda packages
run: |
set -vxeo pipefail
# conda install -y -n base --override-channels -c conda-forge mamba 'python_abi=*=*cp*'
${{ matrix.conda-mamba }} install -y \
python=${{ matrix.python-version }} \
numpy=${{ matrix.numpy-version }} \
pyqt=${{ matrix.pyqt-version }} \
numba \
pip \
'scikit-beam>=0.0.24' \
-c conda-forge
conda list
pip list
- name: Install Conda packages (Windows and OSX)
if: runner.os != 'Linux'
run: |
set -vxeo pipefail
# There are issues in building wheels for pystackreg>0.2.2 on OSX, so install pystackreg from CF
${{ matrix.conda-mamba }} install -y pystackreg -c conda-forge
conda list
pip list
- name: Install PyPI packages
run: |
set -vxeuo pipefail
${{ matrix.conda-mamba }} install -y pystackreg -c conda-forge # Some issue with pystackreg from PyPI
# pip install --upgrade pip setuptools
pip install codecov
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install .
conda list
pip list
python --version
- name: Test with pytest
run: |
set -vxeuo pipefail
coverage run -m pytest -vvv
coverage report