Skip to content

Commit

Permalink
Add basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Oct 8, 2022
1 parent 069e1a1 commit 8ad4eb0
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/test-action-build-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ on:

jobs:
tests:
name: Init [ver=${{ matrix.antsibull-docs-version }}, skip=${{ matrix.skip-init }}, lenient=${{ matrix.lenient }}, fail-on-error=${{ matrix.fail-on-error }}, dest=${{ matrix.dest }}, collections=${{ matrix.collections }}, link-targets=${{ matrix.provide-link-targets != '' }}]
name: Init [ver=${{ matrix.antsibull-docs-version }}, skip=${{ matrix.skip-init }}, lenient=${{ matrix.lenient }}, fail-on-error=${{ matrix.fail-on-error }}, dest=${{ matrix.dest }}, collections=${{ matrix.collections }}, link-targets=${{ matrix.provide-link-targets != '' }}], intersphinx-links=${{ matrix.intersphinx-links }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand All @@ -40,12 +40,20 @@ jobs:
- |
outside_reference_1
outside_reference_2
intersphinx-links: ['']
include:
- skip-init: true
dest: .test/simple-build
lenient: false # unused but needs a value
fail-on-error: false # unused but needs a value
provide-link-targets: ''
- skip-init: false
dest: ''
lenient: false
fail-on-error: true
intersphinx-links: |
amazon_aws:https://ansible-collections.github.io/amazon.aws/branch/main/
ansible_devel:https://docs.ansible.com/ansible-core/devel/
steps:
- name: Checkout
Expand Down Expand Up @@ -73,6 +81,7 @@ jobs:
antsibull-docs-version: ${{ matrix.antsibull-docs-version }}
lenient: ${{ matrix.lenient }}
provide-link-targets: ${{ matrix.provide-link-targets }}
intersphinx-links: ${{ matrix.intersphinx-links }}

- name: assert
env:
Expand Down Expand Up @@ -118,6 +127,13 @@ jobs:
${{ matrix.skip-init }} || ${{ matrix.provide-link-targets == '' }} || grep -- '^.. _outside_reference_2:$' rst/_targets.rst || exit 1
${{ matrix.skip-init }} || ${{ matrix.provide-link-targets == '' }} || (pip install rstcheck && rstcheck --report warning rst/_targets.rst) || exit 1
# Check that intersphinx config was added to conf.py
# These end up wrapped in python formatting, so stick to a naive test.
${{ matrix.skip-init }} || ${{ matrix.intersphinx-links == '' }} || grep -q -- 'ansible_devel' conf.py || exit 1
${{ matrix.skip-init }} || ${{ matrix.intersphinx-links == '' }} || grep -q -- 'https://docs.ansible.com/ansible-core/devel/' conf.py || exit 1
${{ matrix.skip-init }} || ${{ matrix.intersphinx-links == '' }} || grep -q -- 'amazon_aws' conf.py || exit 1
${{ matrix.skip-init }} || ${{ matrix.intersphinx-links == '' }} || grep -q -- 'https://ansible-collections.github.io/amazon.aws/branch/main/' conf.py || exit 1
# check if provide-link-targets was not used when being empty
# short circuit if skip-init is 'true' or matrix.provide-link-targets is not empty
${{ matrix.skip-init }} || ${{ matrix.provide-link-targets != '' }} || ! test -e rst/_targets.rst || exit 1

0 comments on commit 8ad4eb0

Please sign in to comment.