forked from ansible-community/antsibull-build
-
Notifications
You must be signed in to change notification settings - Fork 0
138 lines (113 loc) · 4.24 KB
/
antsibull-docs.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
# This workflow will run antsibull-docs tests
name: antsibull-docs tests
on:
push:
branches: [main]
pull_request:
branches: [main]
# Run once per week (Monday at 04:00 UTC)
schedule:
- cron: '0 4 * * 1'
jobs:
build-simple-docsite:
name: 'Build simple docsite (extra options: ${{ matrix.options }})'
runs-on: ubuntu-latest
strategy:
matrix:
options:
- '--use-current --sphinx-theme sphinx_rtd_theme'
- '--use-current --use-html-blobs --no-breadcrumbs community.crypto community.docker'
- '--no-indexes --squash-hierarchy community.crypto --collection-version 2.0.0'
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install . coverage codecov html5lib
- name: Use antsibull-docs sphinx-init
run: |
coverage run -p --source antsibull -m antsibull.cli.antsibull_docs sphinx-init --lenient --dest-dir . ${{ matrix.options }}
- name: Patch build.sh to supply code coverage
run: |
sed -i build.sh -e 's!antsibull-docs !coverage run -p --source antsibull -m antsibull.cli.antsibull_docs !g'
sed -i build.sh -e 's!sphinx-build !coverage run -p --source antsibull --source sphinx_antsibull_ext -m sphinx.cmd.build !g'
- name: Install dependencies
run: |
pip install ansible-core
pip install -r requirements.txt
- name: Install collections
run:
ansible-galaxy collection install community.docker community.crypto sensu.sensu_go
if: contains(matrix.options, '--use-current')
- name: Build docsite
run: |
./build.sh
- name: Validate HTML
run:
python .github/workflows/validate-html.py build/html/
- name: Test plugin rendering
run:
coverage run -p --source antsibull -m antsibull.cli.antsibull_docs plugin --plugin-type module --dest-dir . community.crypto.acme_account_info
if: contains(matrix.options, '--use-current')
- name: Combine and upload coverage stats
run: |
coverage combine .coverage.*
coverage report
coverage xml -i
codecov
build-stable:
name: 'Build stable docsite'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install . coverage codecov
- name: Get hold of deps file
run: |
curl https://raw.githubusercontent.com/ansible-community/ansible-build-data/main/5/ansible-5.0.0.deps --output ansible.deps
- name: Build stable docs RST files
run: |
mkdir stable-docs
coverage run -p --source antsibull -m antsibull.cli.antsibull_docs stable --deps-file ansible.deps --dest-dir stable-docs --no-breadcrumbs --no-indexes
- name: Combine and upload coverage stats
run: |
coverage combine .coverage.*
coverage report
coverage xml -i
codecov
build-devel:
name: 'Build devel docsite'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install . coverage codecov
- name: Get hold of deps file
run: |
curl https://raw.githubusercontent.com/ansible-community/ansible-build-data/main/6/ansible.in --output ansible.in
- name: Build stable docs RST files
run: |
mkdir devel-docs
coverage run -p --source antsibull -m antsibull.cli.antsibull_docs devel --pieces-file ansible.in --dest-dir devel-docs
- name: Combine and upload coverage stats
run: |
coverage combine .coverage.*
coverage report
coverage xml -i
codecov