Skip to content

Commit e825b35

Browse files
committed
Setup ryte github actions
1 parent d3a07f4 commit e825b35

File tree

1 file changed

+35
-22
lines changed

1 file changed

+35
-22
lines changed
Lines changed: 35 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,39 @@
11
name: "Code Coverage"
22

3-
on: [push, pull_request]
3+
on: [ push, pull_request ]
44

55
jobs:
6-
coverage:
7-
runs-on: ubuntu-latest
8-
steps:
9-
- uses: actions/checkout@v4
10-
- name: Set up Python
11-
uses: actions/setup-python@v5
12-
with:
13-
python-version: '3.11'
14-
- name: Install dependencies
15-
run: |
16-
pip install -r requirements.txt
17-
- name: Run pytest with coverage
18-
run: |
19-
pytest --cov=./ --cov-report=xml
20-
- name: Upload coverage to Codecov
21-
uses: codecov/codecov-action@v1
22-
with:
23-
file: ./coverage.xml
24-
flags: unittests
25-
name: codecov-umbrella
26-
fail_ci_if_error: false
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: [ "3.11.3" ]
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: eifinger/setup-rye@v3
14+
id: setup-rye
15+
with:
16+
enable-cache: true
17+
cache-prefix: ${{ matrix.python-version }}
18+
- name: Pin python-version ${{ matrix.python-version }}
19+
if: steps.setup-rye.outputs.cache-hit != 'true'
20+
run: rye pin ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
if: steps.setup-rye.outputs.cache-hit != 'true'
23+
run: |
24+
rye sync --no-lock
25+
- name: Cache pre-commit
26+
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
27+
with:
28+
path: ~/.cache/pre-commit
29+
key: pre-commit-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
30+
- name: Lint
31+
run: |
32+
rye run pre-commit run --all-files
33+
- name: Test
34+
run: |
35+
rye run pytest --cov=src --cov-report=html
36+
- name: Upload coverage to Codecov
37+
uses: codecov/codecov-action@v1
38+
with:
39+
file: ./htmlcov/index.html

0 commit comments

Comments
 (0)