Skip to content

Lint fix and README updates #190

Lint fix and README updates

Lint fix and README updates #190

Workflow file for this run

name: Test Python package
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: [3.8, 3.9, "3.10", "3.11"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install project and dependencies
run: |
python -m pip install --upgrade pip
if [ -f requirements-dev.txt ]; then pip install -r requirements-dev.txt; fi
pip install .[lark_cython]
- name: Lint with flake8
run: |
flake8 .
- name: Check types with mypy
run: |
mypy mappyfile tests docs/examples
- name: Command line tests
run: |
mappyfile schema mapfile-schema.json
mappyfile schema mapfile-schema-8-0.json --version=8.0
mappyfile validate tests/sample_maps/256_overlay_res.map
mappyfile format tests/sample_maps/256_overlay_res.map tests/sample_maps/256_overlay_res_formatted.map
- name: Test API examples
run: |
pytest docs/examples/api/
- name: Test with pytest without lark_cython
env:
MAPPYFILE_USE_CYTHON: "false"
run: |
pytest
- name: Test with pytest
run: |
pytest --cov mappyfile --cov-report= tests/
- name: Upload coverage data to coveralls.io
run: |
coveralls
env:
COVERALLS_FLAG_NAME: ${{ matrix.test-name }}
COVERALLS_PARALLEL: true
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
# see https://github.com/marketplace/actions/coveralls-github-action
# we can't use coveralls-github-action as it doesn't support xml output
# see https://coveralls-python.readthedocs.io/en/latest/usage/configuration.html#github-actions-support
coveralls:
name: Indicate completion to coveralls.io
needs: test
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --service=github --finish
env:
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}