-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
135 lines (132 loc) · 4.46 KB
/
test-linux.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
134
135
name: Linux tests
on:
push:
branches:
- master
- 5.*
- 4.x
paths:
- '.github/scripts/*.sh'
- '.github/workflows/*.yml'
- 'requirements/*.txt'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'
pull_request:
branches:
- master
- 5.*
- 4.x
paths:
- '.github/scripts/*.sh'
- '.github/workflows/*.yml'
- 'requirements/*.txt'
- 'MANIFEST.in'
- '**.bat'
- '**.py'
- '**.sh'
jobs:
build:
name: Py${{ matrix.PYTHON_VERSION }}, ${{ matrix.INSTALL_TYPE }}, ${{ matrix.TEST_TYPE }}
runs-on: ubuntu-latest
env:
CI: 'true'
CODECOV_TOKEN: "56731c25-9b1f-4340-8b58-35739bfbc52d"
OS: 'linux'
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
RUN_SLOW: ${{ matrix.TEST_TYPE == 'slow' }}
USE_CONDA: ${{ matrix.INSTALL_TYPE == 'conda' }}
USE_GDB: 'false'
strategy:
fail-fast: false
matrix:
INSTALL_TYPE: ['pip', 'conda']
PYTHON_VERSION: ['3.7', '3.9']
TEST_TYPE: ['fast', 'slow']
timeout-minutes: 120
steps:
- name: Checkout Pull Requests
if: github.event_name == 'pull_request'
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Checkout Push
if: github.event_name != 'pull_request'
uses: actions/checkout@v2
- name: Fetch branches
run: git fetch --prune --unshallow
- name: Check build skips
if: github.event_name == 'pull_request'
shell: bash -l {0}
run: source .github/scripts/check_skip.sh
- name: Check build runs
if: github.event_name != 'pull_request'
shell: bash -l {0}
run: echo "RUN_BUILD=true" >> $GITHUB_ENV
- name: Install dependencies
if: env.RUN_BUILD == 'true'
shell: bash
run: |
sudo apt-get update --fix-missing
sudo apt-get install -qq pyqt5-dev-tools libxcb-xinerama0 xterm --fix-missing
- name: Cache conda
uses: actions/cache@v2
env:
# Increase this value to reset cache if requirements/*.txt has not changed
CACHE_NUMBER: 0
with:
path: ~/conda_pkgs_dir
key: ${{ runner.os }}-cacheconda-install${{ matrix.INSTALL_TYPE }}-${{ matrix.PYTHON_VERSION }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('requirements/*.txt') }}
- name: Cache pip
if: env.RUN_BUILD == 'true'
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-cachepip-install${{ matrix.INSTALL_TYPE }}-${{ env.CACHE_NUMBER }}-${{ hashFiles('setup.py') }}
- name: Install Conda
if: env.RUN_BUILD == 'true'
uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test
auto-update-conda: false
auto-activate-base: false
python-version: ${{ matrix.PYTHON_VERSION }}
use-only-tar-bz2: true
channels: conda-forge,defaults
channel-priority: strict
miniforge-variant: Mambaforge
- name: Create test environment
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: bash -l .github/scripts/install.sh
- name: Show test environment
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: |
conda info
conda list
#- name: Setup tmate session
# if: env.RUN_BUILD == 'true'
# uses: mxschmitt/action-tmate@v3
# timeout-minutes: 30
- name: Run manifest checks
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: check-manifest
- name: Run tests with gdb
if: env.USE_GDB == 'true'
shell: bash -l {0}
run: xvfb-run --auto-servernum gdb -return-child-result -batch -ex r -ex py-bt --args python runtests.py -s
- name: Run tests
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py || xvfb-run --auto-servernum python runtests.py
- name: Coverage
if: env.RUN_BUILD == 'true'
shell: bash -l {0}
run: codecov
# Enable this if SSH debugging is required
# - name: Setup tmate session
# uses: andfoy/action-tmate@69bac54a5cc0abe008e87d7470fbf65733745aea
# if: ${{ failure() }}