Skip to content

Commit

Permalink
👷 Add path filters for CI tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronleopold committed Jul 29, 2024
1 parent 4f8fe43 commit f4b761d
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
20 changes: 18 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: path-check
if: "!contains(github.event.pull_request.head.ref, 'release/v') && steps.filter.outputs.changes != '[]'"
name: Rust checks
runs-on: [ubuntu-22.04]
steps:
Expand Down Expand Up @@ -48,7 +64,7 @@ jobs:
fail_ci_if_error: true

check-typescript:
if: "!contains(github.event.pull_request.head.ref, 'release/v')"
if: "!contains(github.event.pull_request.head.ref, 'release/v') && steps.filter.outputs.changes != '[]'"
name: TypeScript checks
runs-on: [ubuntu-22.04]
steps:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,25 @@ 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:
name: Build docker image
runs-on: [ubuntu-22.04]
if: ${{ needs.path-check.outputs.changes != '[]' }}
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down
17 changes: 16 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,23 @@ 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')"
if: "!contains(github.event.pull_request.head.ref, 'release/v') && steps.filter.outputs.changes != '[]'"
name: Build docker image
runs-on: [ubuntu-22.04]
steps:
Expand Down

0 comments on commit f4b761d

Please sign in to comment.