Skip to content

[GitHub] Add path filters to avoid unnecessarily re-running tests#5497

Merged
SirzBenjie merged 4 commits intopagefaultgames:betafrom
SirzBenjie:fix-test-action-triggers
Apr 4, 2025
Merged

[GitHub] Add path filters to avoid unnecessarily re-running tests#5497
SirzBenjie merged 4 commits intopagefaultgames:betafrom
SirzBenjie:fix-test-action-triggers

Conversation

@SirzBenjie
Copy link
Member

@SirzBenjie SirzBenjie commented Mar 8, 2025

What are the changes the user will see?

N/A

Why am I making these changes?

Part of the test refactor (sort of). We do not need to re-run tests in commits that only change files that cannot impact tests (e.g. the README file). These tests are long running.

What are the changes from a developer perspective?

In summary, the test github action will only re-run when source code files, test files, any file that can impact the build, or the test workflow file itself has changes.

Accomplished by added the following paths filter to .github/workflows/tests.yml

paths:
      # src and test files
      - "src/**"
      - "test/**"
      - "public/**" # PLEASE REVIEW -- Does it make sense to include this? Can modifying these break tests? (REMOVE COMMENT AFTER REVIEW)
      # 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" # I think this can impact tests? (REMOVE COMMENT AFTER REVIEW)
      - ".env.*" # PLEASE REVIEW -- can these impact test behavior?
      # Blanket negations for files that cannot impact tests
      - "!**/*.py" # No .py files
      - "!**/*.sh" # No .sh files
      - "!**/*.md" # No .md files
      - "!**/.git*" # .gitkeep and family

Screenshots/Videos

N/A

How to test the changes?

You'd have to make a commit and open a pull request that only changes a file, like README.md, to verify that the tests aren't automatically re-run. The, make a commit and open a pull request that changes any source code file and verify tests are still re-run.

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • [ ] Have I tested the changes manually?
  • [ ] Are all unit tests still passing? (npm run test)
    • [ ] Have I created new automated tests (npm run create-test) or updated existing tests related to the PR's changes?
  • [ ] Have I provided screenshots/videos of the changes (if applicable)?
    • [ ] Have I made sure that any UI change works for both UI themes (default and legacy)?

@SirzBenjie SirzBenjie added Tests Automated tests related GitHub Related to PokéRogue's GitHub (ie: PR or issue templates, workflows, etc) labels Mar 8, 2025
@SirzBenjie SirzBenjie requested a review from a team as a code owner March 8, 2025 15:07
SirzBenjie and others added 2 commits March 15, 2025 23:06
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
@SirzBenjie SirzBenjie force-pushed the fix-test-action-triggers branch from dd2e92a to fb3dab2 Compare March 30, 2025 18:49
@SirzBenjie SirzBenjie force-pushed the fix-test-action-triggers branch from 308e416 to 7317b5a Compare April 4, 2025 21:38
@SirzBenjie SirzBenjie force-pushed the fix-test-action-triggers branch 2 times, most recently from 72a9d0f to fd86122 Compare April 4, 2025 22:10
@SirzBenjie SirzBenjie enabled auto-merge (squash) April 4, 2025 22:10
@SirzBenjie SirzBenjie merged commit 420c2e3 into pagefaultgames:beta Apr 4, 2025
12 checks passed
@SirzBenjie SirzBenjie deleted the fix-test-action-triggers branch April 4, 2025 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

GitHub Related to PokéRogue's GitHub (ie: PR or issue templates, workflows, etc) Tests Automated tests related

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants