mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-01 05:52:17 +02:00
[GitHub] Make tests skip if no filters are matched (#5744)
* Make tests skip if filters are matched * Tweak filter path * Make thing checkout thing * Change where workflow is skipped * Change where workflow is skipped * Update github test filters * Update test-filters.yml --------- Co-authored-by: Wlowscha <54003515+Wlowscha@users.noreply.github.com>
This commit is contained in:
parent
ebac2d1126
commit
9dedf7548b
19
.github/test-filters.yml
vendored
Normal file
19
.github/test-filters.yml
vendored
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
all:
|
||||||
|
- "src/**"
|
||||||
|
- "test/**"
|
||||||
|
- "public/**"
|
||||||
|
# Workflows that can impact tests
|
||||||
|
- ".github/workflows/test*.yml"
|
||||||
|
- ".github/test-filters.yml"
|
||||||
|
# top-level files
|
||||||
|
- "package*.json"
|
||||||
|
- ".nvrmc" # Updates to node version can break tests
|
||||||
|
- "vite*" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
|
||||||
|
- "tsconfig*.json" # tsconfig.json tweaking can impact compilation
|
||||||
|
- "global.d.ts"
|
||||||
|
- ".env*"
|
||||||
|
# Blanket negations for files that cannot impact tests
|
||||||
|
- "!**/*.py" # No .py files
|
||||||
|
- "!**/*.sh" # No .sh files
|
||||||
|
- "!**/*.md" # No .md files
|
||||||
|
- "!**/.git*" # .gitkeep and family
|
5
.github/workflows/test-shard-template.yml
vendored
5
.github/workflows/test-shard-template.yml
vendored
@ -12,11 +12,16 @@ on:
|
|||||||
totalShards:
|
totalShards:
|
||||||
required: true
|
required: true
|
||||||
type: number
|
type: number
|
||||||
|
skip:
|
||||||
|
required: true
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: Shard ${{ inputs.shard }} of ${{ inputs.totalShards }}
|
name: Shard ${{ inputs.shard }} of ${{ inputs.totalShards }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
if: ${{ !inputs.skip }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out Git repository
|
- name: Check out Git repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
57
.github/workflows/tests.yml
vendored
57
.github/workflows/tests.yml
vendored
@ -7,58 +7,30 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main # Trigger on push events to the main branch
|
- main # Trigger on push events to the main branch
|
||||||
- beta # Trigger on push events to the beta branch
|
- beta # Trigger on push events to the beta branch
|
||||||
- release # Trigger on push events to the release branch
|
|
||||||
# go upvote https://github.com/actions/runner/issues/1182 and yell at microsoft until they fix this or ditch yml for workflows
|
|
||||||
paths:
|
|
||||||
# src and test files
|
|
||||||
- "src/**"
|
|
||||||
- "test/**"
|
|
||||||
- "public/**"
|
|
||||||
# Workflows that can impact tests
|
|
||||||
- ".github/workflows/test*.yml"
|
|
||||||
# top-level files
|
|
||||||
- "package*.json"
|
|
||||||
- ".nvrmc" # Updates to node version can break tests
|
|
||||||
- "vite.*.ts" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
|
|
||||||
- "tsconfig*.json" # tsconfig.json tweaking can impact compilation
|
|
||||||
- "global.d.ts"
|
|
||||||
- ".env.*"
|
|
||||||
# Blanket negations for files that cannot impact tests
|
|
||||||
- "!**/*.py" # No .py files
|
|
||||||
- "!**/*.sh" # No .sh files
|
|
||||||
- "!**/*.md" # No .md files
|
|
||||||
- "!**/.git*" # .gitkeep and family
|
|
||||||
|
|
||||||
pull_request:
|
pull_request:
|
||||||
branches:
|
branches:
|
||||||
- main # Trigger on pull request events targeting the main branch
|
- main # Trigger on pull request events targeting the main branch
|
||||||
- beta # Trigger on pull request events targeting the beta branch
|
- beta # Trigger on pull request events targeting the beta branch
|
||||||
- release # Trigger on pull request events targeting the release branch
|
|
||||||
paths: # go upvote https://github.com/actions/runner/issues/1182 and yell at microsoft because until then we have to duplicate this
|
|
||||||
# src and test files
|
|
||||||
- "src/**"
|
|
||||||
- "test/**"
|
|
||||||
- "public/**"
|
|
||||||
# Workflows that can impact tests
|
|
||||||
- ".github/workflows/test*.yml"
|
|
||||||
# top-level files
|
|
||||||
- "package*.json"
|
|
||||||
- ".nvrmc" # Updates to node version can break tests
|
|
||||||
- "vite*" # vite.config.ts, vite.vitest.config.ts, vitest.workspace.ts
|
|
||||||
- "tsconfig*.json" # tsconfig.json tweaking can impact compilation
|
|
||||||
- "global.d.ts"
|
|
||||||
- ".env.*"
|
|
||||||
# Blanket negations for files that cannot impact tests
|
|
||||||
- "!**/*.py" # No .py files
|
|
||||||
- "!**/*.sh" # No .sh files
|
|
||||||
- "!**/*.md" # No .md files
|
|
||||||
- "!**/.git*" # .gitkeep and family
|
|
||||||
merge_group:
|
merge_group:
|
||||||
types: [checks_requested]
|
types: [checks_requested]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
check-path-change-filter:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pull-requests: read
|
||||||
|
outputs:
|
||||||
|
all: ${{ steps.filter.outputs.all }}
|
||||||
|
steps:
|
||||||
|
- name: checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36
|
||||||
|
with:
|
||||||
|
filters: .github/test-filters.yml
|
||||||
|
|
||||||
run-tests:
|
run-tests:
|
||||||
name: Run Tests
|
name: Run Tests
|
||||||
|
needs: check-path-change-filter
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
shard: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
|
||||||
@ -67,3 +39,4 @@ jobs:
|
|||||||
project: main
|
project: main
|
||||||
shard: ${{ matrix.shard }}
|
shard: ${{ matrix.shard }}
|
||||||
totalShards: 10
|
totalShards: 10
|
||||||
|
skip: ${{ needs.check-path-change-filter.outputs.all == 'false'}}
|
||||||
|
Loading…
Reference in New Issue
Block a user