You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
quicktex/.github/workflows/python-package.yml

65 lines
2.0 KiB
YAML

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python Package
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [ 3.7, 3.8, 3.9 ]
os: [ macos-latest, windows-latest, Ubuntu-latest ]
steps:
- uses: actions/checkout@v2
with:
# Whether to checkout submodules: `true` to checkout submodules or `recursive` to
# recursively checkout submodules.
submodules: 'true'
lfs: 'true'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Set up Windows environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Set up Linux environment
if: runner.os == 'Linux'
run: |
echo "CC=gcc-10" >> $GITHUB_ENV
echo "CXX=g++-10" >> $GITHUB_ENV
- name: Set up macOS environment
if: runner.os == 'macOS'
# openMP isnt part of core apple clang for some reason?
run: brew install libomp
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 ninja Pillow click nose parameterized
- 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 --max-complexity=10 --max-line-length=127 --statistics
- name: Compile and install
run: python setup.py build --debug install
- name: Test with nose
run: nosetests tests -d