From 0fbcd4812e90a274581e6ba61a0d8dd855e6f7d8 Mon Sep 17 00:00:00 2001 From: cpelley Date: Thu, 30 Jul 2026 16:03:19 +0100 Subject: [PATCH] testing --- .github/workflows/docs.yml | 68 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/docs.yml diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..01e1bad --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,68 @@ +name: Pull Request Tests + +# on: +# push: +# tags: +# - '*' +# branches: +# - main +# - release/* +# - feature/* +on: [pull_request] + + +jobs: + docs-build: + if: "!contains(github.event.head_commit.message, '[skip ci]')" + runs-on: ubuntu-latest + + steps: + # SETUP + ############################ + - name: Checkout code + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} # Ensure branch is checked out, not detached state (so we can push a commit later) + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + cache: 'pip' + + - name: Add checkout directory to PYTHONPATH + run: echo "PYTHONPATH=$(pwd):$PYTHONPATH" >> $GITHUB_ENV + + - name: Install dependencies + id: install-dependencies + run: | + pip install .[tests,dev] + pip uninstall dagrunner -y + + # DOCUMENTATION + ############################ + - name: Build documentation + run: | + rm -f ./docs/gen_docs/*.md + ./docs/gen_docs dagrunner ./docs + + - name: Check if documentation has changed + id: check-docs + run: | + echo "changed=$(git diff --quiet --exit-code || echo true)" | tee -a $GITHUB_OUTPUT + + # https://github.com/orgs/community/discussions/26560#discussioncomment-3531273 + # This must be our very final step to ensure that it runs only on condition of + # success of all previous steps. A pushed commit will not trigger the re-running + # of this workflow. + - name: Commit and push documentation changes + if: steps.check-docs.outputs.changed == 'true' + run: | + git config user.name github-actions[bot] + git config user.email 41898282+github-actions[bot]@users.noreply.github.com + git add docs/. + git commit -am "Automated reference documentation update for PR ${{ github.event.number }} [skip ci]" + git push + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file