Skip to content

Run unittest only when there is a code change - #1208

Merged
bact merged 2 commits into
PyThaiNLP:devfrom
bact:limiting-unitttest
Jan 16, 2026
Merged

Run unittest only when there is a code change#1208
bact merged 2 commits into
PyThaiNLP:devfrom
bact:limiting-unitttest

Conversation

@bact

@bact bact commented Jan 16, 2026

Copy link
Copy Markdown
Member

The unittest workflow is very expensive.

Try to limit the triggers.
Only run the workflow when there is a change in Python code or in relevant configuration file.

The unittest workflow is very expensive.
Try to limit the triggers.
Only run the workflow when there is a change in Python code or in relevant configuration file.
@bact bact added the github_actions Pull requests that update GitHub Actions code label Jan 16, 2026
@bact
bact requested review from Copilot and wannaphong January 16, 2026 10:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request modifies the unittest workflow to run only when relevant files are changed, switching from a paths-ignore approach to an explicit paths approach. The goal is to reduce expensive unittest workflow runs by being more selective about which file changes trigger the workflow.

Changes:

  • Replaced paths-ignore with explicit paths filters for both push and pull_request triggers
  • Added specific file and directory patterns that should trigger unit tests
  • Included configuration files related to build and testing setup
Comments suppressed due to low confidence (1)

.github/workflows/unittest.yml:37

  • Neither setup.cfg nor setup.py exist in the repository. The project uses pyproject.toml with setuptools backend for configuration (lines 5-7 of pyproject.toml show build-backend = \"setuptools.build_meta\"). These non-existent files should be removed from the trigger paths.
      - "setup.cfg"
      - "setup.py"

Comment thread .github/workflows/unittest.yml Outdated
Comment thread .github/workflows/unittest.yml Outdated
Comment thread .github/workflows/unittest.yml Outdated
Comment thread .github/workflows/unittest.yml Outdated
Comment thread .github/workflows/unittest.yml Outdated
@coveralls

coveralls commented Jan 16, 2026

Copy link
Copy Markdown

Coverage Status

coverage: 53.543%. remained the same
when pulling 6b6183e on bact:limiting-unitttest
into 9eb5c31 on PyThaiNLP:dev.

@sonarqubecloud

Copy link
Copy Markdown

@wannaphong wannaphong left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! This patch will help us for saving free credit github action.

@bact
bact merged commit 17d9942 into PyThaiNLP:dev Jan 16, 2026
27 checks passed
@bact
bact deleted the limiting-unitttest branch January 16, 2026 16:04
@bact bact mentioned this pull request Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants