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:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
|
||||||
- resources/assets/**
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
|
||||||
- resources/assets/**
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths-ignore:
|
|
||||||
- resources/assets/**
|
|
||||||
jobs:
|
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:
|
test:
|
||||||
|
needs: changes
|
||||||
|
if: ${{needs.changes.outputs.changed == 'backend'}}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
@ -53,3 +71,11 @@ jobs:
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
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:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
paths:
|
|
||||||
- resources/assets/**
|
|
||||||
- .github/workflows/unit-frontend.yml
|
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- next
|
|
||||||
paths:
|
|
||||||
- resources/assets/**
|
|
||||||
- .github/workflows/unit-frontend.yml
|
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
branches:
|
branches:
|
||||||
- master
|
- master
|
||||||
- next
|
|
||||||
paths:
|
|
||||||
- resources/assets/**
|
|
||||||
- .github/workflows/unit-frontend.yml
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
LARAVEL_BYPASS_ENV_CHECK: 1
|
LARAVEL_BYPASS_ENV_CHECK: 1
|
||||||
|
|
||||||
jobs:
|
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:
|
test:
|
||||||
|
needs: changes
|
||||||
|
if: ${{needs.changes.outputs.changed == 'frontend'}}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
|
@ -46,3 +57,11 @@ jobs:
|
||||||
uses: codecov/codecov-action@v1
|
uses: codecov/codecov-action@v1
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
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