Skip to content

Commit 0cc1113

Browse files
authored
feat: Added CI (#12)
* Added CI * Added CI
1 parent 9bb83db commit 0cc1113

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

.github/workflows/ci.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Run tests and upload coverage
2+
3+
on:
4+
push
5+
6+
jobs:
7+
test:
8+
name: Run tests with pytest
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
os: ["ubuntu-latest"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
14+
fail-fast: false
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
allow-prereleases: true
24+
25+
- name: Create and activate a virtual environment (Unix)
26+
run: |
27+
curl -LsSf https://astral.sh/uv/install.sh | sh
28+
uv venv .venv
29+
echo "VIRTUAL_ENV=.venv" >> $GITHUB_ENV
30+
echo "$PWD/.venv/bin" >> $GITHUB_PATH
31+
32+
# Install dependencies using uv pip
33+
- name: Install dependencies
34+
run: make install-no-pre-commit
35+
36+
# Run tests with coverage
37+
- name: Run tests under coverage
38+
run: |
39+
coverage run --source=pyversity -m pytest
40+
coverage report
41+
42+
# Upload results to Codecov
43+
- name: Upload results to Codecov
44+
uses: codecov/codecov-action@v4
45+
with:
46+
token: ${{ secrets.CODECOV_TOKEN }}

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ install:
22
uv sync --all-extras
33
uv run pre-commit install
44

5+
install-no-pre-commit:
6+
uv pip install ".[dev]"
7+
58
fix:
69
uv run pre-commit run --all-files
710

0 commit comments

Comments
 (0)