ci: update CI workflows to include path filters #73
1 changed files with 29 additions and 8 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Reference in a new issue