Skip to content

Commit

Permalink
Use a single build job
Browse files Browse the repository at this point in the history
The number of steps that are shared between the two jobs now exceeds the
number of steps that differ. In this case, it seems more maintainable to
use one job with per-step conditions for environment setup.

This should also look nicer downstream - previously there was always one
job that was skipped since they are meant to be mutually exclusive.
  • Loading branch information
victorlin committed Oct 11, 2024
1 parent 654db55 commit 8ce9433
Showing 1 changed file with 12 additions and 23 deletions.
35 changes: 12 additions & 23 deletions .github/workflows/docs-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ env:
SPHINXOPTS: -n -W --keep-going

jobs:
build-conda:
if: inputs.environment-file != ''
build:
runs-on: ubuntu-latest
defaults:
run:
Expand All @@ -59,29 +58,19 @@ jobs:
with:
repository: ${{ inputs.repo }}

- uses: conda-incubator/setup-miniconda@v3
# Set up environment with Conda
- if: inputs.environment-file != ''
uses: conda-incubator/setup-miniconda@v3
with:
environment-file: ${{ inputs.environment-file }}

- run: conda list

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

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

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

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

- run: pip list
- if: inputs.environment-file != ''
run: conda list

# Set up environment with pip
- if: inputs.pip-install-target != ''
run: pip install '${{ inputs.pip-install-target }}'
- if: inputs.pip-install-target != ''
run: pip list

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

0 comments on commit 8ce9433

Please sign in to comment.