Skip to content

Commit 9bab691

Browse files
committed
ci: add codecov
1 parent da5eeab commit 9bab691

File tree

2 files changed

+19
-10
lines changed

2 files changed

+19
-10
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
fail-fast: false
1717
matrix:
1818
# Checks based on python versions ---
19-
python-version: ['3.9', '3.10']
19+
python-version: ["3.9", "3.10"]
2020
requirements: [""]
2121

2222
include:
@@ -43,7 +43,11 @@ jobs:
4343
REQUIREMENTS: ${{ matrix.requirements }}
4444
- name: Run tests
4545
run: |
46-
pytest
46+
pytest --cov
47+
- name: Upload results to Codecov
48+
uses: codecov/codecov-action@v4
49+
with:
50+
token: ${{ secrets.CODECOV_TOKEN }}
4751

4852
pre-commit:
4953
name: "pre-commit checks"
@@ -55,8 +59,8 @@ jobs:
5559
python-version: "${{ matrix.python-version }}"
5660
- name: Install dev dependencies
5761
run: |
58-
python -m pip install --upgrade pip
59-
python -m pip install ".[dev]"
62+
python -m pip install --upgrade pip
63+
python -m pip install ".[dev]"
6064
- uses: pre-commit/[email protected]
6165

6266
release-pypi:
@@ -100,7 +104,6 @@ jobs:
100104
run: |
101105
make docs-build
102106
# push to netlify -------------------------------------------------------
103-
104107
# set release name ----
105108

106109
- name: Configure pull release name
@@ -115,7 +118,6 @@ jobs:
115118
# use branch name, but replace slashes. E.g. feat/a -> feat-a
116119
echo "RELEASE_NAME=${GITHUB_REF_NAME/\//-}" >> $GITHUB_ENV
117120
# deploy ----
118-
119121
- name: Create Github Deployment
120122
uses: bobheadxi/[email protected]
121123
id: deployment
@@ -125,7 +127,7 @@ jobs:
125127
env: ${{ env.RELEASE_NAME }}
126128
ref: ${{ github.head_ref }}
127129
transient: true
128-
logs: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
130+
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
129131

130132
- name: Netlify docs preview
131133
run: |
@@ -149,8 +151,8 @@ jobs:
149151
token: ${{ secrets.GITHUB_TOKEN }}
150152
status: ${{ job.status }}
151153
deployment_id: ${{ steps.deployment.outputs.deployment_id }}
152-
env_url: 'https://${{ steps.deployment.outputs.env }}--quartodoc.netlify.app'
153-
logs: 'https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}'
154+
env_url: "https://${{ steps.deployment.outputs.env }}--quartodoc.netlify.app"
155+
logs: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
154156
- uses: peaceiris/actions-gh-pages@v3
155157
if: github.event_name == 'release'
156158
with:

pyproject.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,14 @@ ci = "https://github.com/machow/quartodoc/actions"
5353

5454

5555
[project.optional-dependencies]
56-
dev = ["pytest<8.0.0", "jupyterlab", "jupytext", "syrupy", "pre-commit"]
56+
dev = [
57+
"pytest<8.0.0",
58+
"pytest-cov",
59+
"jupyterlab",
60+
"jupytext",
61+
"syrupy",
62+
"pre-commit"
63+
]
5764

5865
[project.scripts]
5966
quartodoc = "quartodoc.__main__:cli"

0 commit comments

Comments
 (0)