forked from svenevs/exhale
-
Notifications
You must be signed in to change notification settings - Fork 0
129 lines (126 loc) · 5.6 KB
/
test_python.yaml
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
name: Python
on:
push:
branches:
- master
pull_request:
branches:
- master
# Cancel previous CI runs when new commits are added to a PR.
concurrency:
group: ${{ github.head_ref || github.run_id }}-python
cancel-in-progress: true
jobs:
build:
# NOTE: runner strategy is to split across os and python version, but test multiple
# sphinx versions on a single runner. So do not add a matrix.sphinx-version.
name: ${{ matrix.os }} / ${{ matrix.python-version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@v2
##################################################################################
- name: Install Doxygen (macOS)
if: contains(matrix.os, 'macos')
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install doxygen
- name: Install Doxygen (Ubuntu)
if: contains(matrix.os, 'ubuntu')
run: |
sudo apt-get install -y doxygen
- name: Install Doxygen (Windows)
if: contains(matrix.os, 'windows')
run: |
# This command has been failing with source forge mirror issues
# choco install doxygen.install --version 1.9.6
#
# https://github.com/actions/runner-images/issues/92#issuecomment-1172456433
$url = "https://www.doxygen.nl/files/doxygen-1.9.6.windows.x64.bin.zip"
Start-DownloadWithRetry -Url $url -Name "doxygen.zip" -DownloadPath "C:\"
Extract-7Zip -Path "C:\doxygen.zip" -DestinationPath "C:\Program Files\doxygen"
# Extracts to C:\Program Files\doxygen
# - doxygen.exe
# - doxyindexer.exe
# - doxysearch.cgi.exe
# - doxywizard.exe
# - libclang.dll
echo "C:\Program Files\doxygen" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
##################################################################################
- name: Doxygen Version Dump
run: doxygen --version
##################################################################################
- name: Use Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Python Tools
run: |
pip install -U pip tox codecov coverage
# Sphinx 3.0.0 ###################################################################
- name: Test Python ${{ matrix.python-version }} / sphinx==3.0.0
env:
# NOTE: this is the current minimum supported.
SPHINX_VERSION: '==3.0.0'
run: |
tox -e py -- --cov-report xml:coverage.xml --cov
- name: Upload Code Coverage for Python ${{ matrix.python-version }} / sphinx==3.0.0
run: |
codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py${{ matrix.python-version }}-sphinx3.0.0"
# Don't let code coverage utilities share anything, force clean it all.
- name: Cleanup Python ${{ matrix.python-version }} Testing / Coverage Artifacts
run: |
mv .gitignore nolongerignored
git clean -n
git clean -f
git reset --hard
# Sphinx 4.x #####################################################################
- name: Test Python ${{ matrix.python-version }} / sphinx 4.x
env:
# Test sphinx 4.x.
SPHINX_VERSION: '>=4,<5'
run: |
tox -e py -- --cov-report xml:coverage.xml --cov
- name: Upload Code Coverage for Python ${{ matrix.python-version }} / sphinx 4.x
run: |
codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py${{ matrix.python-version }}-sphinx4.x"
# Don't let code coverage utilities share anything, force clean it all.
- name: Cleanup Python ${{ matrix.python-version }} Testing / Coverage Artifacts
run: |
mv .gitignore nolongerignored
git clean -n
git clean -f
git reset --hard
# Sphinx 5.x #####################################################################
- name: Test Python ${{ matrix.python-version }} / sphinx 5.x
env:
# Test sphinx 5.x.
SPHINX_VERSION: '>=5,<6'
run: |
tox -e py -- --cov-report xml:coverage.xml --cov
- name: Upload Code Coverage for Python ${{ matrix.python-version }} / sphinx 5.x
run: |
codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py${{ matrix.python-version }}-sphinx5.x"
# Don't let code coverage utilities share anything, force clean it all.
- name: Cleanup Python ${{ matrix.python-version }} Testing / Coverage Artifacts
run: |
mv .gitignore nolongerignored
git clean -n
git clean -f
git reset --hard
# Sphinx 6.x #####################################################################
- name: Test Python ${{ matrix.python-version }} / sphinx 6.x
# sphinx 6.x requires python 3.8+
if: ${{ matrix.python-version != '3.7' }}
env:
# Test sphinx 6.x.
SPHINX_VERSION: '>=6,<7'
run: |
tox -e py -- --cov-report xml:coverage.xml --cov
- name: Upload Code Coverage for Python ${{ matrix.python-version }} / sphinx 6.x
if: ${{ matrix.python-version != '3.7' }}
run: |
codecov --required -X gcov -f coverage.xml --name "[GHA] ${{ matrix.os }}-py${{ matrix.python-version }}-sphinx6.x"