Skip to content

Commit 6ef808c

Browse files
authored
Merge pull request #6 from VectorInstitute/add_unit_test_workflow
Add unit test workflow
2 parents 1c25660 + 6fd980f commit 6ef808c

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
run: cd aieng-topic-impl && uv sync --dev
3535

3636
- name: Build package
37-
run: cd aieng-topic-impl && uv build
37+
run: cd aieng-topic-impl && source .venv/bin/activate && uv build
3838

3939
- name: Publish package
4040
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc

.github/workflows/unit_tests.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: unit tests
2+
permissions:
3+
contents: read
4+
pull-requests: write
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
paths:
11+
- .pre-commit-config.yaml
12+
- .github/workflows/code_checks.yml
13+
- .github/workflows/docs.yml
14+
- .github/workflows/unit_tests.yml
15+
- '**.py'
16+
- '**.ipynb'
17+
- uv.lock
18+
- pyproject.toml
19+
- '**.rst'
20+
- '**.md'
21+
pull_request:
22+
branches:
23+
- main
24+
paths:
25+
- .pre-commit-config.yaml
26+
- .github/workflows/code_checks.yml
27+
- .github/workflows/docs.yml
28+
- .github/workflows/unit_tests.yml
29+
- '**.py'
30+
- '**.ipynb'
31+
- uv.lock
32+
- pyproject.toml
33+
- '**.rst'
34+
- '**.md'
35+
36+
jobs:
37+
unit-tests:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/[email protected]
41+
42+
- name: Install uv
43+
uses: astral-sh/setup-uv@c7f87aa956e4c323abf06d5dec078e358f6b4d04
44+
with:
45+
# Install a specific version of uv.
46+
version: "0.7.6"
47+
enable-cache: true
48+
49+
- name: "Set up Python"
50+
uses: actions/setup-python@8d9ed9ac5c53483de85588cdf95a591a75ab9f55
51+
with:
52+
python-version-file: ".python-version"
53+
54+
- name: Install the project
55+
run: cd aieng-topic-impl && uv sync --all-extras --dev
56+
57+
- name: Install dependencies and check code
58+
run: |
59+
cd aieng-topic-impl
60+
source .venv/bin/activate
61+
uv run pytest -m "not integration_test" tests

aieng-topic-impl/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
## aieng-topic-impl

0 commit comments

Comments
 (0)