1
0
Fork 0
maximum-weight-matching/.github/workflows/main.yml

80 lines
2.3 KiB
YAML
Raw Normal View History

2023-04-14 10:29:22 +02:00
# Github Actions workflow file
name: main
# Controls when the workflow will run
on:
# Run when commits are pushed.
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# Run checks on Python code.
check-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install --upgrade mypy pylint
- name: Run mypy
run: mypy --disallow-incomplete-defs python tests
- name: Run pylint
run: pylint --ignore=test_mwmatching.py python tests
2023-04-14 11:23:32 +02:00
# Run tests on Python code.
full-test-python:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install dependencies
run: pip install --upgrade coverage
- name: Show Python version
run: python3 --version
- name: Run unittests
run: python3 python/test_mwmatching.py
- name: Check unittest coverage
run: |
coverage erase
coverage run --branch python/test_mwmatching.py
coverage report -m --fail-under=99
2023-04-14 12:49:49 +02:00
- name: Run test graphs
run: >
python3 python/run_matching.py --verify
tests/graphs/chain_n1000.edge
tests/graphs/chain_n5000.edge
tests/graphs/sparse_delta_n1004.edge
tests/graphs/triangles_n1002.edge
tests/graphs/triangles_n5001.edge
tests/graphs/random_n1000_m10000.edge
tests/graphs/random_n2000_m10000.edge
2023-04-14 11:23:32 +02:00
2023-04-14 11:06:29 +02:00
# Run unittests on multiple Python versions.
unittest-python:
runs-on: ubuntu-latest
strategy:
matrix:
2023-04-14 11:23:32 +02:00
python-version: ["3.7", "3.8", "3.9", "3.10", "3.12-dev", "pypy3.9"]
2023-04-14 11:06:29 +02:00
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
2023-04-14 11:23:32 +02:00
- name: Show Python version
run: python3 --version
2023-04-14 11:06:29 +02:00
- name: Run unittests
run: python3 python/test_mwmatching.py