-
-
Notifications
You must be signed in to change notification settings - Fork 12
117 lines (114 loc) · 4.03 KB
/
run-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
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
name: Run tests
on:
push:
branches:
- master
pull_request:
branches:
- master
jobs:
main:
strategy:
fail-fast: false
matrix:
OS: ['ubuntu', 'macos', 'windows']
PYTHON_VERSION: ['3.9', '3.10', '3.11']
SPYDER_SOURCE: ['git']
name: ${{ matrix.OS }} py${{ matrix.PYTHON_VERSION }} spyder-from-${{ matrix.SPYDER_SOURCE }}
runs-on: ${{ matrix.OS }}-latest
env:
CI: True
PYTHON_VERSION: ${{ matrix.PYTHON_VERSION }}
steps:
- name: Checkout branch
uses: actions/checkout@v4
with:
path: 'spyder-line-profiler'
- name: Install System Packages
if: matrix.OS == 'ubuntu'
run: |
sudo apt-get update --fix-missing
sudo apt-get install -qq pyqt5-dev-tools libxcb-xinerama0 xterm --fix-missing
- name: Install Conda
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
auto-update-conda: true
python-version: ${{ matrix.PYTHON_VERSION }}
- name: Checkout Spyder from git
if: matrix.SPYDER_SOURCE == 'git'
uses: actions/checkout@v4
with:
repository: 'spyder-ide/spyder'
path: 'spyder'
- name: Install Spyder's dependencies (main)
if: matrix.SPYDER_SOURCE == 'git'
shell: bash -l {0}
run: mamba env update --file spyder/requirements/main.yml
- name: Install Spyder's dependencies (Linux)
if: matrix.SPYDER_SOURCE == 'git' && matrix.OS == 'ubuntu'
shell: bash -l {0}
run: mamba env update --file spyder/requirements/linux.yml
- name: Install Spyder's dependencies (Mac / Windows)
if: matrix.SPYDER_SOURCE == 'git' && matrix.OS != 'ubuntu'
shell: bash -l {0}
run: mamba env update --file spyder/requirements/${{ matrix.OS }}.yml
- name: Install Spyder from source
if: matrix.SPYDER_SOURCE == 'git'
shell: bash -l {0}
run: pip install --no-deps -e spyder
- name: Install plugin dependencies (without Spyder)
if: matrix.SPYDER_SOURCE == 'git'
shell: bash -l {0}
run: |
python spyder-line-profiler/.github/scripts/generate-without-spyder.py
mamba install --file spyder-line-profiler/requirements/without-spyder.txt -y
- name: Install plugin dependencies
if: matrix.SPYDER_SOURCE == 'conda'
shell: bash -l {0}
run: mamba install --file spyder-line-profiler/requirements/conda.txt -y
- name: Install test dependencies
shell: bash -l {0}
run: |
mamba install nomkl -y -q
mamba install --file spyder-line-profiler/requirements/tests.txt -y
- name: Install plugin
shell: bash -l {0}
run: pip install --no-deps -e spyder-line-profiler
- name: Show environment information
shell: bash -l {0}
run: |
mamba info
mamba list
- name: Run tests (Linux)
if: matrix.OS == 'ubuntu'
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
shell: bash
command: |
. ~/.profile
xvfb-run --auto-servernum pytest spyder-line-profiler/spyder_line_profiler --cov=spyder_line_profiler --cov-report=xml -vv
- name: Run tests (MacOS)
if: matrix.OS == 'macos'
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
shell: bash
command: |
. ~/.profile
pytest spyder-line-profiler/spyder_line_profiler -x -vv
- name: Run tests (Windows)
if: matrix.OS == 'windows'
uses: nick-fields/retry@v3
with:
timeout_minutes: 10
max_attempts: 3
command: pytest spyder-line-profiler/spyder_line_profiler -x -vv
- name: Upload coverage to Codecov
if: matrix.OS == 'ubuntu' && matrix.PYTHON_VERSION == '3.10'
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}