forked from useblocks/sphinx-needs
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (127 loc) · 4.12 KB
/
ci.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
130
131
132
133
134
135
136
137
name: CI
on:
push:
branches: [master]
pull_request:
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.8
uses: actions/setup-python@v4
with:
python-version: '3.8'
- uses: pre-commit/[email protected]
tests-core:
name: "Core py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false # Set on "false" to get the results of ALL builds
matrix:
os: ["ubuntu-latest"]
# 3.9.8 seems to be broken with type_ast
# https://www.mail-archive.com/[email protected]/msg1829077.html
python-version: ["3.8", "3.11"]
sphinx-version: ["5.0", "6.0", "7.0"]
include:
- os: "windows-latest"
python-version: "3.8"
sphinx-version: "5.0"
steps:
- uses: actions/checkout@v4
- name: Set Up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
python -m pip install sphinx~=${{ matrix.sphinx-version }} -e .[test]
python -m pip freeze
- name: Run pytest
run: |
python -m pytest -v --ignore=tests/benchmarks -m "not jstest" --cov=sphinx_needs --cov-report=xml --cov-report=term-missing tests
coverage xml
- name: Upload to Codecov
if: github.repository == 'useblocks/sphinx-needs' && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
name: sphinx-need-pytests
flags: pytests
file: ./coverage.xml
fail_ci_if_error: true
tests-js:
name: "JS py${{ matrix.python-version }} sphinx~=${{ matrix.sphinx-version }} ${{ matrix.os }}"
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: "ubuntu-latest"
python-version: "3.8"
sphinx-version: "5.0"
- os: "ubuntu-latest"
python-version: "3.11"
sphinx-version: "7.0"
steps:
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18
- name: Install Cypress Test Framework
run: npm install cypress
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install dependencies
run: |
python -m pip install sphinx~=${{ matrix.sphinx-version }} -e .[test]
python -m pip freeze
- name: Run pytest
run: |
python -m pytest -v --ignore=tests/benchmarks -m "jstest" tests
tests-no-mpl:
name: Test matplotlib uninstalled
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Update pip
run: python -m pip install --upgrade pip
- name: Install Dependencies
run: |
python -m pip install -e .[test,docs]
python -m pip uninstall -y matplotlib numpy
python -m pip freeze
- name: Run pytest
run: |
python -m pytest -v tests/no_mpl_tests.py
- name: Run HTML build
# the docs should build without matplotlib (just issuing warnings)
run: sphinx-build -b html . _build
working-directory: docs
check:
# This job does nothing and is only used for the branch protection
# see https://github.com/marketplace/actions/alls-green#why
if: always()
needs:
- lint
- tests-core
- tests-js
- tests-no-mpl
runs-on: ubuntu-latest
steps:
- name: Decide whether the needed jobs succeeded or failed
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}