mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 22:24:31 +02:00

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Alexandre Teles (afterSt0rm) <alexandre.teles@ufba.br>
49 lines
1.1 KiB
YAML
49 lines
1.1 KiB
YAML
name: "PyTest & Codecov | Testing and Code Coverage"
|
|
|
|
on:
|
|
push:
|
|
branches: [dev]
|
|
pull_request:
|
|
types: [opened, reopened, edited, synchronize]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
default_branch: dev
|
|
|
|
jobs:
|
|
pytest:
|
|
name: pytest
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
actions: read
|
|
contents: read
|
|
security-events: write
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: "3.11.6"
|
|
|
|
- name: Install project dependencies
|
|
run: |
|
|
python -m pip install --upgrade pip
|
|
if [ -f requirements.txt ];
|
|
then pip install -r requirements.txt;
|
|
fi
|
|
|
|
- name: Run pytest
|
|
uses: pavelzw/pytest-action@v2
|
|
with:
|
|
custom-arguments: "--cov --cov-report=xml"
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
|
|
|
- name: Upload coverage reports to Codecov
|
|
uses: codecov/codecov-action@v3
|
|
env:
|
|
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
|