mirror of
https://github.com/koel/koel
synced 2024-11-10 06:34:14 +00:00
feat(build): use path-filters
This commit is contained in:
parent
02c5e79dac
commit
f24fd44a3a
4 changed files with 62 additions and 17 deletions
38
.github/workflows/unit-backend.yml
vendored
38
.github/workflows/unit-backend.yml
vendored
|
@ -3,20 +3,38 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- resources/assets/**
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- resources/assets/**
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- master
|
||||
paths-ignore:
|
||||
- resources/assets/**
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
outputs:
|
||||
changed: ${{ steps.filter.outputs.backend }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
backend:
|
||||
- '!./resources/assets/**'
|
||||
- '!./.github/workflows/unit-frontend.yml'
|
||||
- '!./vite.config.js'
|
||||
- '!./package.json'
|
||||
- '!./yarn.lock'
|
||||
- '!./.eslintrc'
|
||||
- '!./cypress.json'
|
||||
|
||||
test:
|
||||
needs: changes
|
||||
if: ${{needs.changes.outputs.changed == 'backend'}}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -53,3 +71,11 @@ jobs:
|
|||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
skip:
|
||||
name: Skip
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{needs.changes.outputs.changed != 'backend'}}
|
||||
steps:
|
||||
- name: Skip
|
||||
run: echo "No backend-related changes detected, skipping."
|
||||
|
|
41
.github/workflows/unit-frontend.yml
vendored
41
.github/workflows/unit-frontend.yml
vendored
|
@ -3,29 +3,40 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
paths:
|
||||
- resources/assets/**
|
||||
- .github/workflows/unit-frontend.yml
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
paths:
|
||||
- resources/assets/**
|
||||
- .github/workflows/unit-frontend.yml
|
||||
workflow_dispatch:
|
||||
branches:
|
||||
- master
|
||||
- next
|
||||
paths:
|
||||
- resources/assets/**
|
||||
- .github/workflows/unit-frontend.yml
|
||||
|
||||
env:
|
||||
LARAVEL_BYPASS_ENV_CHECK: 1
|
||||
|
||||
jobs:
|
||||
changes:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
pull-requests: read
|
||||
outputs:
|
||||
changed: ${{ steps.filter.outputs.backend }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: dorny/paths-filter@v2
|
||||
id: filter
|
||||
with:
|
||||
filters: |
|
||||
frontend:
|
||||
- './resources/assets/**'
|
||||
- './vite.config.js'
|
||||
- './package.json'
|
||||
- './yarn.lock'
|
||||
- './.eslintrc'
|
||||
- './cypress.json'
|
||||
|
||||
test:
|
||||
needs: changes
|
||||
if: ${{needs.changes.outputs.changed == 'frontend'}}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -46,3 +57,11 @@ jobs:
|
|||
uses: codecov/codecov-action@v1
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
|
||||
skip:
|
||||
needs: changes
|
||||
if: ${{needs.changes.outputs.changed != 'frontend'}}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Skip
|
||||
run: echo "No frontend-related changes detected, skipping."
|
||||
|
|
0
.gitmodules
vendored
0
.gitmodules
vendored
Loading…
Reference in a new issue