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 05b78b8
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 3 deletions.
21 changes: 19 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: 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:
Expand Down Expand Up @@ -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:
Expand Down
17 changes: 17 additions & 0 deletions .github/workflows/experimental.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 05b78b8

Please sign in to comment.