-
Notifications
You must be signed in to change notification settings - Fork 212
152 lines (152 loc) · 5.63 KB
/
main.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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: Tests
on:
# Run this workflow every time a new commit is pushed to or a pull request is created from one of these branches
push:
branches: [main, "stable/*"]
pull_request:
branches: [main, "stable/*"]
jobs:
# NOTE: The ubuntu-22.04 and macos-latest tests have been separated out because ubuntu
# requires installing some additional libraries (libglu1-mesa) for Gmsh to run. Please
# consider this aspect before combining the tests for both the OS platforms.
ubuntu-tests:
# Name the Job
name: tests-python${{ matrix.python-version }}-ubuntu-latest
# Set the type of machine to run on
runs-on: ubuntu-22.04
# Set matrix for runs-on
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ubuntu-latest-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }}
restore-keys: |
ubuntu-latest-${{ matrix.python-version }}-pip-tests-
ubuntu-latest-${{ matrix.python-version }}-pip-
ubuntu-latest-${{ matrix.python-version }}
- name: Install Deps
run: |
python -m pip install -U tox==4.11.0 setuptools==67.3.1 virtualenv==20.24.3 wheel==0.38.4
sudo apt install libglu1-mesa=9.0.2-1 libglu1-mesa-dev=9.0.2-1
- name: Install and Run Tests
run: tox -e py
macos-tests:
# Name the Job
name: tests-python${{ matrix.python-version }}-macOS-latest
# Set the type of machine to run on
runs-on: macos-12
# Set matrix for runs-on
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- name: Chekout code
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: macOS-latest-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }}
restore-keys: |
macOS-latest-${{ matrix.python-version }}-pip-tests-
macOS-latest-${{ matrix.python-version }}-pip-
macOS-latest-${{ matrix.python-version }}
- name: Install Deps
run: python -m pip install -U tox==4.11.0 setuptools==67.3.1 virtualenv==20.24.3 wheel==0.38.4
- name: Install and Run Tests
run: tox -e py
windows-tests:
name: tests-python${{ matrix.python-version }}-windows
runs-on: windows-2022
strategy:
matrix:
python-version: ["3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Pip cache
uses: actions/cache@v3
with:
path: ~\AppData\Local\pip\Cache
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-tests-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-tests-
${{ runner.os }}-${{ matrix.python-version }}-pip-
${{ runner.os }}-${{ matrix.python-version }}-
- name: Install deps
run: |
python -m pip install -U tox==4.11.0 cvxopt==1.3.0 setuptools==67.3.1 virtualenv==20.24.3 wheel==0.38.4
shell: pwsh
- name: Install and Run Tests
run: tox --sitepackages -e py
shell: bash -l {0}
lint:
name: lint
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-lint-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }}
restore-keys: |
${{ runner.os }}-${{ matrix.python-version }}-pip-lint-
${{ runner.os }}-${{ matrix.python-version }}-pip-
${{ runner.os }}-${{ matrix.python-version }}-
- name: Install Deps
run: python -m pip install -U tox==4.11.0
- name: Run lint
run: tox -elint
docs:
name: docs
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Pip cache
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-${{ matrix.python-version }}-pip-docs-${{ hashFiles('setup.py','requirements-dev.txt','requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-docs-
${{ runner.os }}-pip-
${{ runner.os }}-
- name: Install Deps
run: |
python -m pip install -U tox==4.11.0
sudo apt update
sudo apt install -y graphviz=2.42.2-6 pandoc=2.9.2.1-3ubuntu2 qtbase5-dev=5.15.3+dfsg-2ubuntu0.2 qt5-qmake=5.15.3+dfsg-2ubuntu0.2
- name: Build Docs
run: tox -edocs
- uses: actions/upload-artifact@v2
with:
name: html_docs
path: docs/_build/html