Skip to content

Add Tex2ImgCodec

Add Tex2ImgCodec #21

Workflow file for this run

# GitHub's default python testing workflow.
# 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: testing
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .
pip install flake8 pytest pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --statistics
- name: Run tests
run: |
# run tests and generate coverage
pytest --cov=. --junitxml=pytest.xml --cov-report=term-missing:skip-covered | tee pytest-coverage.txt
- name: Pytest coverage comment
id: coverageComment
uses: MishaKav/pytest-coverage-comment@main
with:
pytest-coverage-path: ./pytest-coverage.txt
junitxml-path: ./pytest.xml
- name: Run pyright
uses: jakebailey/pyright-action@v1.3.0
- name: Check for test failures/low coverage
run: |
# Reject if there were any failures or errors, or coverage below 80%
covperc=${{ steps.coverageComment.outputs.coverage }}
# Strip % character off the end of code coverage (no need to convert to int in bash)
if [[ ${covperc:0:2} < 80 ]] ; then
core.setFailed('Test coverage must be at least 80%')
fi
if [[ ${{ steps.coverageComment.outputs.errors }} > 0 ]] ; then
core.setFailed('Tests must have no errors')
fi
if [[ ${{ steps.coverageComment.outputs.failures }} > 0 ]] ; then
core.setFailed('Tests must have no failures')
fi