only run tests when needed
This commit is contained in:
@@ -6,7 +6,32 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
changes:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
server: ${{ steps.filter.outputs.server }}
|
||||||
|
client: ${{ steps.filter.outputs.client }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Detect changed paths
|
||||||
|
uses: dorny/paths-filter@v3
|
||||||
|
id: filter
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
server:
|
||||||
|
- 'Overlord-Server/**'
|
||||||
|
client:
|
||||||
|
- 'Overlord-Client/**'
|
||||||
|
- 'go.work'
|
||||||
|
- 'go.work.sum'
|
||||||
|
|
||||||
server-tests:
|
server-tests:
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.server == 'true' || github.event_name == 'workflow_dispatch'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -31,6 +56,8 @@ jobs:
|
|||||||
run: bun test ./src
|
run: bun test ./src
|
||||||
|
|
||||||
client-tests:
|
client-tests:
|
||||||
|
needs: changes
|
||||||
|
if: needs.changes.outputs.client == 'true' || github.event_name == 'workflow_dispatch'
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
|
|||||||
Reference in New Issue
Block a user