From 05b78b88856b22cb656bca57384484f05cb51548 Mon Sep 17 00:00:00 2001 From: Aaron Leopold <36278431+aaronleopold@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:42:46 -0700 Subject: [PATCH] :construction_worker: Add path filters for CI tasks --- .github/workflows/ci.yaml | 21 +++++++++++++++++++-- .github/workflows/experimental.yml | 17 +++++++++++++++++ .github/workflows/nightly.yml | 18 +++++++++++++++++- 3 files changed, 53 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2e8fbf245..918b87e81 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -5,8 +5,24 @@ on: branches: - main jobs: + code-changes-check: + runs-on: [ubuntu-22.04] + outputs: + changes: ${{steps.filter.outputs.changes}} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + apps: ./apps/** + crates: ./crates/** + docker: ./docker/** + packages: ./packages/** + check-rust: - if: "!contains(github.event.pull_request.head.ref, 'release/v')" + needs: code-changes-check + if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.changes != '[]'" name: Rust checks runs-on: [ubuntu-22.04] steps: @@ -48,7 +64,8 @@ jobs: fail_ci_if_error: true check-typescript: - if: "!contains(github.event.pull_request.head.ref, 'release/v')" + needs: code-changes-check + if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.changes != '[]'" name: TypeScript checks runs-on: [ubuntu-22.04] steps: diff --git a/.github/workflows/experimental.yml b/.github/workflows/experimental.yml index 14ae65ec0..3abcf3b92 100644 --- a/.github/workflows/experimental.yml +++ b/.github/workflows/experimental.yml @@ -17,9 +17,26 @@ env: DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} jobs: + code-changes-check: + runs-on: [ubuntu-22.04] + outputs: + changes: ${{steps.filter.outputs.changes}} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + apps: ./apps/** + crates: ./crates/** + docker: ./docker/** + packages: ./packages/** + nightly-docker-build: + needs: code-changes-check name: Build docker image runs-on: [ubuntu-22.04] + if: ${{ needs.code-changes-check.outputs.changes != '[]' }} steps: - name: Checkout repository uses: actions/checkout@v3 diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 529aa7359..fef9640f4 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -17,8 +17,24 @@ env: DOCKER_PASSWORD: ${{ secrets.DOCKERHUB_TOKEN }} jobs: + code-changes-check: + runs-on: [ubuntu-22.04] + outputs: + changes: ${{steps.filter.outputs.changes}} + steps: + - uses: actions/checkout@v4 + - uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + apps: ./apps/** + crates: ./crates/** + docker: ./docker/** + packages: ./packages/** + nightly-docker-build: - if: "!contains(github.event.pull_request.head.ref, 'release/v')" + needs: code-changes-check + if: "!contains(github.event.pull_request.head.ref, 'release/v') && needs.code-changes-check.outputs.changes != '[]'" name: Build docker image runs-on: [ubuntu-22.04] steps: