only run tests when needed
This commit is contained in:
@@ -6,7 +6,32 @@ on:
|
||||
workflow_dispatch:
|
||||
|
||||
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:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.server == 'true' || github.event_name == 'workflow_dispatch'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@@ -31,6 +56,8 @@ jobs:
|
||||
run: bun test ./src
|
||||
|
||||
client-tests:
|
||||
needs: changes
|
||||
if: needs.changes.outputs.client == 'true' || github.event_name == 'workflow_dispatch'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
|
||||
Reference in New Issue
Block a user