-
Notifications
You must be signed in to change notification settings - Fork 5
111 lines (106 loc) · 3.53 KB
/
Copy pathtest.yml
File metadata and controls
111 lines (106 loc) · 3.53 KB
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
name: test
on:
push:
branches: [ master, testing ]
paths-ignore:
- 'README*'
- 'LICENSE'
pull_request:
branches: [ master ]
paths-ignore:
- 'README*'
- 'LICENSE'
workflow_dispatch:
inputs:
debug_enabled:
description: 'Enable tmate debugging (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ['2.7', '3.6', '3.7', '3.8', '3.9']
steps:
- uses: actions/checkout@v2
- name: Install packages (Linux)
run: |
sudo apt-get update -qq
# install fonts.
sudo apt-get install -qq fontconfig
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
sudo apt-get install -qq msttcorefonts ttf-mscorefonts-installer
sudo fc-cache -vf
# install format converters.
sudo apt-get install -qq inkscape ghostscript dvipng
# install tex.
sudo apt-get install -qq texlive texlive-latex-extra
# install x server.
sudo apt-get install -qq python-tk xvfb
if: ${{ runner.os == 'Linux' }}
- name: Install packages (MacOS)
run: |
brew upgrade
# install fonts.
brew tap homebrew/cask-fonts
brew install font-times-new-roman
# install format converters.
brew install --cask inkscape
brew install ghostscript
# install tex.
brew install --cask basictex
# install x server.
brew install gtk+3 python-tk
if: ${{ runner.os == 'MacOS' }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ matrix.python-version }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
- name: Fix issue with matplotlib 1.4
# avoid an issue in distutil when installing matplotlib 1.4.
# see https://stackoverflow.com/a/27085321
run: |
sudo apt-get install -qq libfreetype6-dev
if: ${{ matrix.os == 'ubuntu-18.04' }}
- name: Fix MacOS backend issue with matplotlib < 3.2
# see https://stackoverflow.com/q/4130355 and https://matplotlib.org/3.1.0/faq/osx_framework.html
run: |
echo 'backend: Agg' >> matplotlibrc
if: ${{ runner.os == 'MacOS' }}
- name: Select tests
run: |
TOXENV=$(tox --listenvs | grep $(echo "py${{ matrix.python-version }}-" | tr -d . | sed -e "s/pypypy/pypy/") | tr "\n" ",")
echo $TOXENV
echo "TOXENV=$TOXENV" >> $GITHUB_ENV
- name: Setup tmate session if enabled debugging
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled }}
with:
limit-access-to-actor: true
timeout-minutes: 60
- name: Test (Linux)
run: |
xvfb-run --auto-servernum tox
if: ${{ runner.os == 'Linux' }}
- name: Test (MacOS)
run: |
tox
if: ${{ runner.os == 'MacOS' }}
- uses: bcomnes/cleanup-xvfb@v1
if: ${{ runner.os == 'Linux' }}
- name: Upload coverage data
uses: codecov/codecov-action@v1
with:
fail_ci_if_error: true