From 8ce943371e61366eab4e003b1bfcaf24d9ac0968 Mon Sep 17 00:00:00 2001 From: Victor Lin <13424970+victorlin@users.noreply.github.com> Date: Fri, 11 Oct 2024 16:10:05 -0700 Subject: [PATCH] Use a single build job 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. --- .github/workflows/docs-ci.yaml | 35 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/.github/workflows/docs-ci.yaml b/.github/workflows/docs-ci.yaml index 89355ef..47cc362 100644 --- a/.github/workflows/docs-ci.yaml +++ b/.github/workflows/docs-ci.yaml @@ -48,8 +48,7 @@ env: SPHINXOPTS: -n -W --keep-going jobs: - build-conda: - if: inputs.environment-file != '' + build: runs-on: ubuntu-latest defaults: run: @@ -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 }}