Use poetry in CI #69
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: Tests | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 3.10 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.10" | |
- name: Install poetry | |
uses: abatilo/actions-poetry@v3 | |
- name: Install the project dependencies | |
run: poetry install | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings | |
poetry run flake8 . --count --exit-zero --max-line-length=119 --statistics | |
- name: Coverage with pytest | |
run: | | |
poetry run coverage run --omit "tests/*.py" -m pytest ./tests/ --junitxml=./report.xml -s | |
poetry run coverage report | |
poetry run coverage xml | |
# genbadge tests -i ./report.xml -s -o ./tests.svg | |
# genbadge coverage -i ./coverage.xml -s -o ./coverage.svg | |
# - name: Setup node | |
# uses: actions/setup-node@v1 | |
# - name: Upload badge to GitHub | |
# uses: LasyIsLazy/github-upload-action@v0.1.0 | |
# with: | |
# access-token: ${{ secrets.ACCESS_TOKEN }} | |
# file-path: coverage.svg | |
# owner: NicolasGrosjean | |
# repo: Paradox_localization_utils | |
# branch-name: actions | |
# remote-dir: badges | |
# commit-message: Update coverage badge | |