diff --git a/.github/workflows/deploy-docs.yml b/.github/workflows/deploy-docs.yml index d4fecf3..c6b3400 100644 --- a/.github/workflows/deploy-docs.yml +++ b/.github/workflows/deploy-docs.yml @@ -2,12 +2,39 @@ name: Deploy Documentation on: push: + branches: + - main pull_request: workflow_dispatch: jobs: + changed-files: + name: Changed Files + runs-on: ubuntu-latest + outputs: + docs-change: ${{ steps.changed-files.outputs.docs-change_any_modified == 'true' }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 50 # Assume PRs are less than 50 commits + + - name: Find changed files + uses: tj-actions/changed-files@v44 + id: changed-files + with: + files_yaml: | + docs-change: + - .github/workflows/deploy-docs.yml + - docs/** + - package.json + - package-lock.json + vercel: runs-on: ubuntu-latest + needs: [changed-files] + if: ${{ needs.changed-files.outputs.docs-change == 'true' }} steps: - name: Checkout Code diff --git a/.github/workflows/draft-release-tag.yml b/.github/workflows/draft-release-tag.yml index 7d1aafb..3379ac2 100644 --- a/.github/workflows/draft-release-tag.yml +++ b/.github/workflows/draft-release-tag.yml @@ -10,11 +10,11 @@ permissions: jobs: update_release_draft: + runs-on: ubuntu-latest permissions: contents: write pull-requests: read - runs-on: ubuntu-latest steps: # Drafts your next Release notes as Pull Requests are merged into "master" - uses: release-drafter/release-drafter@v6 diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index c231d2f..b59a4e9 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -1,14 +1,63 @@ name: Linting -on: [push, pull_request] +on: + push: + branches: + - main + pull_request: env: PIP_DISABLE_PIP_VERSION_CHECK: 1 jobs: + changed-files: + name: Changed Files + runs-on: ubuntu-latest + outputs: + docs-change: ${{ steps.changed-files.outputs.docs-change_any_modified == 'true' }} + python-change: ${{ steps.changed-files.outputs.python-change_any_modified == 'true' }} + project-change: ${{ steps.changed-files.outputs.project-change_any_modified == 'true' }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 50 # Assume PRs are less than 50 commits + + - name: Find changed files + uses: tj-actions/changed-files@v44 + id: changed-files + with: + files_yaml: | + common: &common + - .github/workflows/linter.yml + + docs-change: + - *common + - docs/** + - package.json + - package-lock.json + + python-change: + - *common + - src/** + - tests/** + - ruff.toml + - poetry.lock + - pyproject.toml + + project-change: + - *common + - package.json + - .prettierignore + - .github/ISSUE_TEMPLATE/** + - .github/*.md + lint-python: name: Python runs-on: ubuntu-latest + needs: [changed-files] + if: ${{ needs.changed-files.outputs.python-change == 'true' }} steps: - name: Checkout repository @@ -33,6 +82,8 @@ jobs: lint-docs: name: Docs runs-on: ubuntu-latest + needs: [changed-files] + if: ${{ needs.changed-files.outputs.docs-change == 'true' }} steps: - name: Checkout repository @@ -56,6 +107,8 @@ jobs: lint-project: name: Project runs-on: ubuntu-latest + needs: [changed-files] + if: ${{ needs.changed-files.outputs.project-change == 'true' }} steps: - name: Checkout repository @@ -86,4 +139,5 @@ jobs: - name: Whether the whole linting suite passed uses: re-actors/alls-green@v1.2.2 with: + allowed-skips: ${{ toJSON(needs) }} jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/test-worker.yml b/.github/workflows/test-worker.yml index ebf71a8..c8d71a5 100644 --- a/.github/workflows/test-worker.yml +++ b/.github/workflows/test-worker.yml @@ -2,6 +2,8 @@ name: Run Test Suite on: push: + branches: + - main pull_request: workflow_dispatch: @@ -21,9 +23,44 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} jobs: + changed-files: + name: Changed Files + runs-on: ubuntu-latest + outputs: + docs-change: ${{ steps.changed-files.outputs.docs-change_any_modified == 'true' }} + python-change: ${{ steps.changed-files.outputs.python-change_any_modified == 'true' }} + project-change: ${{ steps.changed-files.outputs.project-change_any_modified == 'true' }} + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 50 # Assume PRs are less than 50 commits + + - name: Find changed files + uses: tj-actions/changed-files@v44 + id: changed-files + with: + files_yaml: | + common: &common + - .github/workflows/test-worker.yml + + docs-change: + - *common + - docs/** + - package.json + - package-lock.json + + python-change: + - *common + - src/** + - tests/** + test-python: name: "${{ matrix.python-version }} on ${{ matrix.os }}" runs-on: "${{ matrix.os }}-latest" + needs: [changed-files] + if: ${{ needs.changed-files.outputs.python-change == 'true' }} continue-on-error: ${{ startsWith(matrix.python-version, '~') }} # Allows unstable Python versions to fail @@ -59,6 +96,8 @@ jobs: test-docs: name: Docs runs-on: ubuntu-latest + needs: [changed-files] + if: ${{ needs.changed-files.outputs.docs-change == 'true' }} steps: - name: Checkout repository @@ -89,4 +128,5 @@ jobs: - name: Whether the whole test suite passed uses: re-actors/alls-green@v1.2.2 with: + allowed-skips: ${{ toJSON(needs) }} jobs: ${{ toJSON(needs) }}