Skip to content
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
9 changes: 8 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,20 @@ jobs:
with:
repo: nextstrain/zika-tutorial

test-docs-ci:
test-docs-ci-conda:
uses: ./.github/workflows/docs-ci.yaml
with:
repo: nextstrain/docs.nextstrain.org
docs-directory: .
environment-file: environment.yml

test-docs-ci-pip:
uses: ./.github/workflows/docs-ci.yaml
with:
repo: nextstrain/augur
docs-directory: docs/
pip-install-target: .[dev]

test-readme:
runs-on: ubuntu-latest
steps:
Expand Down
42 changes: 33 additions & 9 deletions .github/workflows/docs-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,33 @@ on:

environment-file:
description: >-
Path to conda environment file (e.g. docs/conda.yml)
Path to conda environment file. (e.g. docs/conda.yml)
type: string
required: true
required: false

pip-install-target:
description: >-
Pip install target. (e.g. local directory which contains setup.py, project URL)
type: string
required: false

make-target:
description: >-
Sphinx builder name. See https://www.sphinx-doc.org/en/master/man/sphinx-build.html#options
type: string
default: html

env:
# Used for `make` steps.
# -n: warn on missing references
# -W: error on warnings
# --keep-going: find all warnings
# https://www.sphinx-doc.org/en/master/man/sphinx-build.html
SPHINXOPTS: -n -W --keep-going

jobs:
build:
build-conda:
if: inputs.environment-file != ''
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -52,9 +67,18 @@ jobs:

- run: make ${{ inputs.make-target }}
working-directory: ${{ inputs.docs-directory }}
env:
# https://www.sphinx-doc.org/en/master/man/sphinx-build.html
# -n: warn on missing references
# -W: error on warnings
# --keep-going: find all warnings
SPHINXOPTS: -n -W --keep-going

build-pip:
if: inputs.pip-install-target != ''
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
repository: ${{ inputs.repo }}

- run: pip install '${{ inputs.pip-install-target }}'

- run: pip list

- run: make ${{ inputs.make-target }}
working-directory: ${{ inputs.docs-directory }}