Skip to content

Commit

Permalink
[ci] Fixes to docs, PR and PR cleanup workflows.
Browse files Browse the repository at this point in the history
* Fix paths that triggers different library testing jobs.
* Fix condition to run library testing jobs.
* Make docs-building workflow callable and use it on PR workflows.
* On the PR cleanup workflow, there is no need to install GitHub CLI.

Signed-off-by: boschmitt <[email protected]>
  • Loading branch information
boschmitt committed Nov 22, 2024
1 parent 5a9919c commit 8e82a92
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
name: Documentation

on:
workflow_call:

workflow_dispatch:
branches:
- main

push:
branches:
- main
# FIXME: remove?
- "pull-request/[0-9]+"
paths:
- '.github/workflows/docs.yaml'
- 'docs/**'
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pr_cache_cleanup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ jobs:
env:
GH_TOKEN: ${{ github.token }}
run: |
bash .github/workflows/scripts/install_git_cli.sh
pr_number=$(echo ${{ github.event.ref }} | sed 's/.*\///')
# Fetch the list of cache keys
Expand Down
47 changes: 32 additions & 15 deletions .github/workflows/pr_workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
build-cudaq: ${{ steps.filter.outputs.build-cudaq }}
build-docs: ${{ steps.filter.outputs.build-docs }}
build-all: ${{ steps.filter.outputs.build-all }}
build-qec: ${{ steps.filter.outputs.build-qec }}
build-solvers: ${{ steps.filter.outputs.build-solvers }}
Expand All @@ -40,6 +41,12 @@ jobs:
- '.github/workflows/cudaq_bump.yml'
- '.github/actions/get-cudaq-build/**'
- '.cudaq_version'
build-docs:
- '.github/workflows/docs.yaml'
- 'docs/**'
- '**/*.cpp'
- '**/*.h'
- '**/*.py'
build-all:
- '.github/actions/build-lib/action.yaml'
- '.github/actions/build-lib/build_all.yaml'
Expand All @@ -51,26 +58,26 @@ jobs:
- '.github/actions/build-lib/build_qec.sh'
- '.github/workflows/lib_qec.yaml'
- 'cmake/Modules/**'
- 'libs/core/**.cpp'
- 'libs/core/**.h'
- 'libs/core/**/*.cpp'
- 'libs/core/**/*.h'
- 'libs/core/**/CMakeLists.txt'
- 'libs/qec/**.cpp'
- 'libs/qec/**.h'
- 'libs/qec/**.in'
- 'libs/qec/**.py'
- 'libs/qec/**/*.cpp'
- 'libs/qec/**/*.h'
- 'libs/qec/**/*.in'
- 'libs/qec/**/*.py'
- 'libs/qec/**/CMakeLists.txt'
build-solvers:
- '.github/actions/build-lib/action.yaml'
- '.github/actions/build-lib/build_solvers.sh'
- '.github/workflows/lib_solvers.yaml'
- 'cmake/Modules/**'
- 'libs/core/**.cpp'
- 'libs/core/**.h'
- 'libs/core/**/*.cpp'
- 'libs/core/**/*.h'
- 'libs/core/**/CMakeLists.txt'
- 'libs/solvers/**.cpp'
- 'libs/solvers/**.h'
- 'libs/solvers/**.in'
- 'libs/solvers/**.py'
- 'libs/solvers/**/*.cpp'
- 'libs/solvers/**/*.h'
- 'libs/solvers/**/*.in'
- 'libs/solvers/**/*.py'
- 'libs/solvers/**/CMakeLists.txt'
build-cudaq:
Expand Down Expand Up @@ -109,21 +116,31 @@ jobs:
save-build: true
save-ccache: false

build-docs:
name: Docs
needs: [check-changes, build-cudaq]
if: needs.check-changes.outputs.build-docs == 'true'
uses: ./.github/workflows/docs.yaml

# In the following, we need the `always()` fucntion in order to guarantee
# that these jobs will run when their conditions are met, even if the
# `build-cudaq` job is skipped.

build-all:
name: All libs
needs: [check-changes, build-cudaq]
if: needs.check-changes.outputs.build-all == 'true' || needs.check-changes.outputs.build-cudaq == 'true'
if: always() && (needs.check-changes.outputs.build-all == 'true' || needs.check-changes.outputs.build-cudaq == 'true')
uses: ./.github/workflows/all_libs.yaml

build-qec:
name: QEC
needs: [check-changes, build-cudaq]
if: needs.check-changes.outputs.build-qec == 'true' || needs.check-changes.outputs.build-cudaq == 'true'
if: always() && (needs.check-changes.outputs.build-qec == 'true' || needs.check-changes.outputs.build-cudaq == 'true')
uses: ./.github/workflows/lib_qec.yaml

build-solvers:
name: Solvers
needs: [check-changes, build-cudaq]
if: needs.check-changes.outputs.build-solvers == 'true' || needs.check-changes.outputs.build-cudaq == 'true'
if: always() && (needs.check-changes.outputs.build-solvers == 'true' || needs.check-changes.outputs.build-cudaq == 'true')
uses: ./.github/workflows/lib_solvers.yaml

0 comments on commit 8e82a92

Please sign in to comment.