Skip to content

Commit 1980e4e

Browse files
committed
adding workflows
1 parent 5652952 commit 1980e4e

File tree

4 files changed

+130
-0
lines changed

4 files changed

+130
-0
lines changed

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
# Maintain dependencies for GitHub Actions
4+
- package-ecosystem: "github-actions"
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"

.github/workflows/ci.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
schedule:
9+
- cron: '00 01 * * *'
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
build:
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
python-version: ["3.10", "3.11", "3.12"]
20+
21+
steps:
22+
- uses: actions/checkout@v5
23+
- name: Install uv
24+
uses: astral-sh/setup-uv@v7
25+
with:
26+
# Install a specific version of uv.
27+
version: "0.5.1"
28+
enable-cache: true
29+
cache-dependency-glob: "uv.lock"
30+
- name: Set up Python ${{ matrix.python-version }}
31+
run: uv python install ${{ matrix.python-version }}
32+
- name: Install the project
33+
run: uv sync --all-extras --dev
34+
- name: Run tests
35+
# For example, using `pytest`
36+
run: uv run just coverage
37+
- name: Upload Coverage to Codecov
38+
uses: codecov/codecov-action@v5
39+
with:
40+
files: coverage.xml # optional
41+
fail_ci_if_error: true # optional (default = false)
42+
verbose: true # optional (default = false)
43+
token: ${{ secrets.CODECOV_TOKEN }} # required
44+
- name: Archive code coverage results
45+
if: matrix.python-version == '3.12'
46+
uses: actions/upload-artifact@v4
47+
with:
48+
name: code-coverage-report
49+
path: coverage.xml
50+
retention-days: 2
51+
post:
52+
runs-on: ubuntu-latest
53+
needs: build
54+
if: github.event.pull_request
55+
steps:
56+
- uses: actions/checkout@v5
57+
- name: download coverage
58+
uses: actions/download-artifact@v5
59+
with:
60+
name: code-coverage-report
61+
- name: check coverage
62+
run: |
63+
if [ -f coverage.xml ]; then
64+
echo "Coverage file exists"
65+
else
66+
echo "Coverage file does not exist"
67+
exit 1
68+
fi
69+
- name: post coverage
70+
uses: orgoro/coverage@v3.2
71+
with:
72+
coverageFile: coverage.xml
73+
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Lint
2+
on:
3+
pull_request:
4+
push:
5+
branches:
6+
- main
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
9+
cancel-in-progress: true
10+
11+
jobs:
12+
isort:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v5
16+
- uses: isort/isort-action@v1
17+
with:
18+
sortPaths: "src" # only sort files in the src directory
19+
ruff:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v5
23+
- uses: chartboost/ruff-action@v1
24+
black:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- uses: actions/checkout@v5
28+
- uses: psf/black@stable
29+
pyright:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v5
33+
- name: Install uv
34+
uses: astral-sh/setup-uv@v7
35+
with:
36+
# Install a specific version of uv.
37+
version: "0.6.14"
38+
enable-cache: true
39+
cache-dependency-glob: "uv.lock"
40+
- name: Install the project
41+
run: uv sync --all-extras --dev
42+
- run: echo "$PWD/.venv/bin" >> $GITHUB_PATH
43+
- uses: jakebailey/pyright-action@v2
44+
with:
45+
pylance-version: latest-release

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# misc
2+
.DS_Store
3+
4+
debug/
5+
16
# Byte-compiled / optimized / DLL files
27
__pycache__/
38
*.py[cod]

0 commit comments

Comments
 (0)