From 4438959b12ce916f1c274a754b2dff1a9db67467 Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 9 Oct 2024 12:55:13 +0200 Subject: [PATCH] Run only necessary jobs in CI --- .github/workflows/ci.yml | 4 ++++ .github/workflows/get-changed-files.yml | 21 +++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d9c11af..b1a978b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,13 +20,17 @@ jobs: test: name: Test + if: github.event_name != 'pull_request' || fromJSON(needs.get-changed-files.outputs.changed-files)['needs_tests'] == 'true' needs: + - get-changed-files - pre-commit uses: ./.github/workflows/test-action.yml docs: name: Docs + if: github.event_name != 'pull_request' || fromJSON(needs.get-changed-files.outputs.changed-files)['docs'] == 'true' needs: + - get-changed-files - pre-commit uses: ./.github/workflows/docs-action.yml diff --git a/.github/workflows/get-changed-files.yml b/.github/workflows/get-changed-files.yml index 7d799e9..65a84b5 100644 --- a/.github/workflows/get-changed-files.yml +++ b/.github/workflows/get-changed-files.yml @@ -35,6 +35,27 @@ jobs: pre-commit: - added|modified|deleted: - .pre-commit-config.y?(a)ml + - .pylintrc + docs: + - added|modified|deleted: + - .github/** + - changelog/** + - docs/** + - noxfile.py + - CHANGELOG.md + - pyproject.toml + needs_tests: + - added|modified|deleted: + - .github/** + - data/** + - jinja_extensions/** + - project/** + - tasks/** + - tests/** + - copier.yml + - noxfile.py + - pyproject.toml + - pytest.ini - name: Echo Changed Files Output run: echo "${{ toJSON(steps.changed-files.outputs) }}"