1
0
Fork 0

Moved repository to Gitea

This commit is contained in:
Joris van Rantwijk 2024-03-08 12:09:30 +01:00
parent 9cabdce600
commit 77dac28056
3 changed files with 57 additions and 108 deletions

View File

@ -1,103 +0,0 @@
# 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
# 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
- 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
# Run unittests on multiple Python versions.
unittest-python:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.12-dev", "pypy3.9"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Show Python version
run: python3 --version
- name: Run unittests
run: python3 python/test_mwmatching.py
# Run tests on C++ code.
test-cpp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install Boost
run: sudo apt-get install -y libboost-test-dev
- name: Show GCC version
run: g++ --version
- name: Build mwmatching
run: make -C cpp run_matching test_mwmatching
- name: Run unittests
run: cpp/test_mwmatching
- name: Run test graphs
run: >
python3 tests/run_test.py --solver cpp/run_matching --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

View File

@ -63,11 +63,6 @@ But it is definitely still possible that I overlooked something.
This repository is just a side-project for me.
I don't have any plans to develop this into a polished, full-featured, supported software package.
If you find any bugs in this code, please let me know by reporting an issue in
the Github repository.
I will try to respond to issue reports and fix bugs.
I will probably not accept pull requests.
## Credits

57
run_tests.sh Executable file
View File

@ -0,0 +1,57 @@
#!/bin/sh
set -e
echo
echo "Running Python unit tests"
echo
python3 --version
echo
python3 python/test_mwmatching.py
echo
echo "Checking test coverage"
echo
coverage erase
coverage run --branch python/test_mwmatching.py
coverage report -m
echo
echo "Running Python code on test graphs"
echo
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
echo
echo "Running C++ unit tests"
echo
g++ --version
echo
make -C cpp run_matching test_mwmatching
cpp/test_mwmatching
echo
echo "Running C++ code on test graphs"
echo
python3 tests/run_test.py --solver cpp/run_matching --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