-
Notifications
You must be signed in to change notification settings - Fork 10
81 lines (69 loc) · 2.54 KB
/
tests.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
name: Tests
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master, dev ]
jobs:
tests:
runs-on: ubuntu-latest
env:
DISPLAY: ":99.0"
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Cache Conda
uses: actions/cache@v1
env:
# Increase this value to reset cache manually
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key:
${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('environment.yml') }}
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/setup.py') }}-${{ hashFiles('.github/dependabot/constraints.txt') }}
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
environment-file: environment.yml
miniconda-version: "latest"
channel-priority: strict
use-only-tar-bz2: true # IMPORTANT: This needs to be set for caching to work properly!
- name: Install OS dependencies
run: |
sudo apt-get -q update
sudo -E apt-get -yq --no-install-suggests --no-install-recommends install \
libxkbcommon-x11-0 x11-apps libgl1-mesa-glx qtbase5-dev xvfb
echo $'\nexport CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}' >> ~/.profile
echo $'\nexport LD_LIBRARY_PATH=${CONDA_PREFIX}/lib:${LD_LIBRARY_PATH}' >> ~/.profile
- name: Install python dependencies
shell: bash -l {0}
run: |
git submodule update --init
python3 -m pip install --upgrade pip
python3 -m pip install ".[test]" --constraint .github/dependabot/constraints.txt
- name: Build and test with pytest - parallel
shell: bash -l {0}
run: |
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1400x900x24
sleep 3
# test parallel version
python3 setup.py build_ext --inplace --with-tests
python3 setup.py test -v
- name: Build and test with pytest - serial
shell: bash -l {0}
run: |
# test serial version
export BUILD_SERIAL_FOAM=1
python3 setup.py build_ext --inplace --with-tests
# Only the algorithms change in the serial build, so we don't bother
# running the other tests.
python3 -m pytest extra_foam/algorithms -v
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1