Skip to content

Commit

Permalink
Improve build and docs tests (#380)
Browse files Browse the repository at this point in the history
* Stop using deprecated subcommand.

* Bump version number.

* Prepare for more antsibull-docs tests.

* Adjust test naming.

* Add stable docsite build.

* More tests.

* Run rstcheck on smaller docsite instead.

* rstcheck gives too many errors.
  • Loading branch information
felixfontein authored Jan 7, 2022
1 parent 76fa98d commit ef0a4f0
Show file tree
Hide file tree
Showing 4 changed files with 137 additions and 68 deletions.
127 changes: 127 additions & 0 deletions .github/workflows/antsibull-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# 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 06:00 UTC)
schedule:
- cron: '0 6 * * 1'

jobs:
build-simple-docsite:
name: 'Build simple docsite (extra options: ${{ matrix.options }})'
runs-on: ubuntu-latest
strategy:
matrix:
options:
- ''
- '--use-html-blobs --no-breadcrumbs --no-indexes'

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: Use antsibull-docs sphinx-init
run: |
coverage run -p --source antsibull -m antsibull.cli.antsibull_docs sphinx-init --use-current --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

- name: Build docsite
run: |
./build.sh
- 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
- 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
File renamed without changes.
15 changes: 10 additions & 5 deletions .github/workflows/build-dumb-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,21 @@ jobs:
-U --user
.
- name: Generate the list of compatible versions
# FIXME: should 2.10 / 2.10.0 be parametrized?
# FIXME: should 5 / 5.0.0 be parametrized?
run: >-
~/.local/bin/antsibull-build
new-ansible 2.10.0
--data-dir ansible-build-data/2.10
new-ansible 5.0.0
--data-dir ansible-build-data/5
- name: Prepare an Ansible dist
run: >-
~/.local/bin/antsibull-build
prepare 5.0.0
--data-dir ansible-build-data/5
- name: Create a single-tarball Ansible dist
run: >-
~/.local/bin/antsibull-build
single 2.10.0
--data-dir ansible-build-data/2.10
rebuild-single 5.0.0
--data-dir ansible-build-data/5
--sdist-dir dist
- name: >-
Check out ${{
Expand Down
63 changes: 0 additions & 63 deletions .github/workflows/build-simple-docsite.yml

This file was deleted.

0 comments on commit ef0a4f0

Please sign in to comment.