Skip to content

Commit

Permalink
Setup ryte github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
horrormyth committed May 31, 2024
1 parent d3a07f4 commit e825b35
Showing 1 changed file with 35 additions and 22 deletions.
57 changes: 35 additions & 22 deletions .github/workflows/code_coverage.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
name: "Code Coverage"

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
run: |
pip install -r requirements.txt
- name: Run pytest with coverage
run: |
pytest --cov=./ --cov-report=xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.11.3" ]
steps:
- uses: actions/checkout@v4
- uses: eifinger/setup-rye@v3
id: setup-rye
with:
enable-cache: true
cache-prefix: ${{ matrix.python-version }}
- name: Pin python-version ${{ matrix.python-version }}
if: steps.setup-rye.outputs.cache-hit != 'true'
run: rye pin ${{ matrix.python-version }}
- name: Install dependencies
if: steps.setup-rye.outputs.cache-hit != 'true'
run: |
rye sync --no-lock
- name: Cache pre-commit
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1
with:
path: ~/.cache/pre-commit
key: pre-commit-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Lint
run: |
rye run pre-commit run --all-files
- name: Test
run: |
rye run pytest --cov=src --cov-report=html
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
file: ./htmlcov/index.html

0 comments on commit e825b35

Please sign in to comment.