-
-
Notifications
You must be signed in to change notification settings - Fork 29
83 lines (70 loc) · 2.18 KB
/
unittests.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
name: Unittest
on:
push:
branches: [master]
paths:
- '**.py'
- '.github/workflows/unittests.yml'
pull_request:
branches: [master]
paths:
- '**.py'
- '.github/workflows/unittests.yml'
concurrency:
group: unittests-${{ github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash
jobs:
unittests:
name: ${{ matrix.os }}+py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-latest, macos-11]
python-version: ['3.9', '3.11']
experimental: [false]
include:
- os: ubuntu-20.04
python-version: 3.6
- os: macos-11
python-version: 3.6
steps:
- name: Checkout ${{ github.ref }}
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get detailed Python version
id: full-python-version
run: echo ::set-output name=version::$(python -c "import sys; print('-'.join(str(v) for v in sys.version_info))")
- name: Python Cache - ${{ matrix.os }}-python-${{ steps.full-python-version.outputs.version }}
uses: actions/cache@v2
with:
path: ${{ env.pythonLocation }}
key: new-${{ matrix.os }}-python-${{ steps.full-python-version.outputs.version }}
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade --upgrade-strategy eager pip setuptools wheel babel
pip3 install --upgrade --upgrade-strategy eager pillow scipy numpy
- name: List environment
env:
GITHUB_CONTEXT: ${{ toJSON(github) }}
JOB_CONTEXT: ${{ toJSON(job) }}
STEPS_CONTEXT: ${{ toJSON(steps) }}
RUNNER_CONTEXT: ${{ toJSON(runner) }}
STRATEGY_CONTEXT: ${{ toJSON(strategy) }}
MATRIX_CONTEXT: ${{ toJSON(matrix) }}
run: |
pip3 list
env
- name: Run Unittests
run: |
python -m unittest discover test -v
if ${{ matrix.experimental }} == true; then
exit 0
fi