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:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
|
||||||
- 'backend/**'
|
|
||||||
- 'frontend/**'
|
|
||||||
- '.gitea/workflows/ci.yml'
|
|
||||||
|
|
||||||
jobs:
|
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:
|
checkstyle:
|
||||||
name: "Checkstyle Main"
|
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:
|
container:
|
||||||
image: "cimg/openjdk:23.0-node"
|
image: "cimg/openjdk:23.0-node"
|
||||||
steps:
|
steps:
|
||||||
|
@ -37,7 +55,8 @@ jobs:
|
||||||
|
|
||||||
eslint:
|
eslint:
|
||||||
name: 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:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -64,7 +83,8 @@ jobs:
|
||||||
|
|
||||||
prettier:
|
prettier:
|
||||||
name: 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:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
|
@ -91,7 +111,8 @@ jobs:
|
||||||
|
|
||||||
test-build:
|
test-build:
|
||||||
name: 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:
|
container:
|
||||||
image: catthehacker/ubuntu:act-latest
|
image: catthehacker/ubuntu:act-latest
|
||||||
steps:
|
steps:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue