ci: update CI workflows to include path filters #73

Merged
jank merged 4 commits from pipeline-rules into main 2025-03-13 09:04:46 +00:00
Showing only changes of commit fd7c92ebb1 - Show all commits

View file

@ -2,15 +2,33 @@ name: CI
on:
pull_request:
paths:
- 'backend/**'
- 'frontend/**'
- '.gitea/workflows/ci.yml'
jobs:
changed_files:
name: Get Changed Files
runs-on: ubuntu-latest
outputs:
backend: ${{ steps.filter.outputs.backend }}
frontend: ${{ steps.filter.outputs.frontend }}
workflow: ${{ steps.filter.outputs.workflow }}
steps:
- uses: actions/checkout@v4
- name: Check for file changes
uses: dorny/paths-filter@v2
id: filter
with:
filters: |
backend:
- 'backend/**'
frontend:
- 'frontend/**'
workflow:
- '.gitea/workflows/**'
checkstyle:
name: "Checkstyle Main"
if: ${{ contains(github.event.pull_request.changed_files_json, 'backend/') || contains(github.event.pull_request.changed_files_json, '.gitea/workflows/ci.yml') }}
needs: changed_files
if: ${{ needs.changed_files.outputs.backend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: "cimg/openjdk:23.0-node"
steps:
@ -37,7 +55,8 @@ jobs:
eslint:
name: eslint
if: ${{ contains(github.event.pull_request.changed_files_json, 'frontend/') || contains(github.event.pull_request.changed_files_json, '.gitea/workflows/ci.yml') }}
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
steps:
@ -64,7 +83,8 @@ jobs:
prettier:
name: prettier
if: ${{ contains(github.event.pull_request.changed_files_json, 'frontend/') || contains(github.event.pull_request.changed_files_json, '.gitea/workflows/ci.yml') }}
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
steps:
@ -91,7 +111,8 @@ jobs:
test-build:
name: test-build
if: ${{ contains(github.event.pull_request.changed_files_json, 'frontend/') || contains(github.event.pull_request.changed_files_json, '.gitea/workflows/ci.yml') }}
needs: changed_files
if: ${{ needs.changed_files.outputs.frontend == 'true' || needs.changed_files.outputs.workflow == 'true' }}
container:
image: catthehacker/ubuntu:act-latest
steps: