Skip to content

Commit 22711b3

Browse files
committed
🔧 (coverage.yml): add GitHub Actions workflow for test coverage reporting
This workflow runs on pushes to the master branch, sets up a Python environment using Poetry, installs dependencies, runs tests, collects coverage, and uploads reports to Codecov. 📝 (deploy.yml): add newline for consistency in GitHub Actions workflow
1 parent 99b3e0b commit 22711b3

File tree

2 files changed

+37
-0
lines changed

2 files changed

+37
-0
lines changed

.github/workflows/coverage.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Coverage
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
coverage:
9+
runs-on: ubuntu-22.04
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: actions/setup-python@v4
13+
with:
14+
python-version: "3.12"
15+
- name: Install Poetry
16+
uses: abatilo/actions-poetry@v2
17+
- name: Setup a local virtual environment
18+
working-directory: ./backend
19+
run: |
20+
poetry config virtualenvs.create true --local
21+
poetry config virtualenvs.in-project true --local
22+
- uses: actions/cache@v3
23+
name: Define a cache for the virtual environment based on the dependencies lock file
24+
with:
25+
path: ./backend/.venv
26+
key: venv-${{ hashFiles('backend/poetry.lock') }}
27+
- name: Install dependencies
28+
working-directory: ./backend
29+
run: poetry install --all-extras
30+
- name: Run tests and collect coverage
31+
working-directory: ./backend
32+
run: poetry run pytest --cov=ormagic --cov-report=xml
33+
- name: Upload coverage raports to Codecov
34+
uses: codecov/[email protected]
35+
with:
36+
token: ${{ secrets.CODECOV_TOKEN }}

.github/workflows/deploy.yml

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- master
6+
67
jobs:
78
tests:
89
uses: ./.github/workflows/tests.yml

0 commit comments

Comments
 (0)