mirror of
https://github.com/OMGeeky/flucto-heisskleber.git
synced 2026-01-17 17:07:50 +01:00
* Fix coverage report generation. * Only run action on push to main * Don't run tests on tests themselves. * Fix on push directive
52 lines
1.2 KiB
YAML
52 lines
1.2 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
tests:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Check out the repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python 3.10
|
|
uses: actions/setup-python@v5.0.0
|
|
with:
|
|
python-version: "3.10"
|
|
|
|
- name: Cache poetry install
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: ~/.local
|
|
key: poetry-1.7.1-0
|
|
|
|
- name: Install poetry
|
|
uses: snok/install-poetry@v1
|
|
with:
|
|
version: 1.7.1
|
|
virtualenvs-create: true
|
|
virtualenvs-in-project: true
|
|
|
|
- name: cache deps
|
|
id: cache-deps
|
|
uses: actions/cache@v4
|
|
with:
|
|
path: .venv
|
|
key: pydeps-${{ hashFiles('**/poetry.lock') }}
|
|
|
|
- run: poetry install --no-interaction # --no-root
|
|
if: steps.cache-deps.outputs.cache-hit != 'true'
|
|
|
|
# - run: poetry install --no-interaction
|
|
|
|
- run: poetry run pytest --cov --cov-report xml
|
|
|
|
- name: Upload coverage roports to Codecov
|
|
uses: codecov/codecov-action@v4
|
|
env:
|
|
CODECOV_TOKEN: ${{secrets.CODECOV_TOKEN}}
|