Add unit test workflow#6
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new GitHub Actions workflow for running unit tests and updates the publish workflow to activate the virtual environment before building.
- Introduce
.github/workflows/unit_tests.ymlto install dependencies viauvand runpytest(excluding integration tests). - Update
.github/workflows/publish.ymlbuild step to source the virtual environment beforeuv build.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| .github/workflows/unit_tests.yml | New workflow defining triggers, environment setup, and test execution |
| .github/workflows/publish.yml | Modified build step to activate .venv prior to packaging |
Comments suppressed due to low confidence (1)
.github/workflows/unit_tests.yml:57
- [nitpick] The step name 'Install dependencies and check code' suggests only setup; it actually runs pytest. Consider renaming it to 'Run unit tests' for clarity.
- name: Install dependencies and check code
| - '**.py' | ||
| - '**.ipynb' | ||
| - uv.lock | ||
| - pyproject.toml |
There was a problem hiding this comment.
The workflow triggers on documentation files (e.g., '*.rst'), causing tests to run on docs-only changes. Use paths-ignore for docs or restrict triggers to code files to avoid unnecessary runs.
Suggested change
| - pyproject.toml | |
| - pyproject.toml | |
| paths-ignore: |
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4.2.2 | ||
|
|
There was a problem hiding this comment.
Consider adding actions/cache after checkout to cache dependencies (e.g., .venv or pip cache) and speed up subsequent job runs.
Suggested change
| - name: Cache Python dependencies | |
| uses: actions/cache@v3 | |
| with: | |
| path: | | |
| ~/.cache/pip | |
| aieng-topic-impl/.venv | |
| key: ${{ runner.os }}-pip-${{ hashFiles('**/pyproject.toml', '**/uv.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-pip- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Type
Github action workflow
Short Description
...
Tests Added
...