Skip to content

[pre-commit.ci] pre-commit autoupdate (#507) #164

[pre-commit.ci] pre-commit autoupdate (#507)

[pre-commit.ci] pre-commit autoupdate (#507) #164

Workflow file for this run

name: Pytest
on:
push:
branches: ['main']
pull_request:
branches: ['main']
paths:
- '**.py'
- '**.js'
- '**.jinja2'
- pyproject.toml
- test_requirements.txt
- .github/workflows/pytest.yml
permissions:
contents: read
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12']
services:
redis:
image: redis
ports:
- 6379:6379
options: --entrypoint redis-server
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install project
run: |
pip install 'git+https://github.com/hasgeek/coaster'
pip install -e .
pip install -r test_requirements.txt
- name: Install pytest-github-actions-annotate-failures
run: pip install pytest-github-actions-annotate-failures
- name: Test with pytest
run: |
pytest --showlocals --cov=baseframe
- name: Prepare coverage report
run: |
mkdir -p coverage
coverage lcov -o coverage/baseframe.lcov
- name: Upload coverage report to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ./coverage/baseframe.lcov
flag-name: python-${{ matrix.python-version }}
parallel: true
finish:
needs: test
runs-on: ubuntu-latest
steps:
- name: Publish to Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.github_token }}
path-to-lcov: ./coverage/baseframe.lcov
parallel-finished: true