Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve build and docs tests #380

Merged
merged 8 commits into from
Jan 7, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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.