|
1 | | -# This workflow will install Python dependencies, run tests and lint with a single version of Python |
2 | | -# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
3 | | - |
4 | | -name: Algorithmic Battle - Problem Files |
| 1 | +name: Algorithmic Battle |
5 | 2 |
|
6 | 3 | on: |
7 | 4 | push: |
|
10 | 7 | branches: [ main, develop ] |
11 | 8 |
|
12 | 9 | jobs: |
13 | | - build: |
14 | | - |
| 10 | + lint: |
15 | 11 | runs-on: ubuntu-latest |
16 | | - |
17 | 12 | steps: |
18 | 13 | - uses: actions/checkout@v2 |
19 | | - - name: Set up Python 3.9 |
| 14 | + - name: Set up Python 3.6 |
20 | 15 | uses: actions/setup-python@v2 |
21 | 16 | with: |
22 | | - python-version: 3.9 |
| 17 | + python-version: 3.6 |
23 | 18 | - name: Install dependencies |
24 | 19 | run: | |
25 | 20 | python -m pip install --upgrade pip |
26 | 21 | pip install flake8 flake8-docstrings |
27 | | - if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
28 | | - git clone https://github.com/Benezivas/algobattle.git |
29 | | - cd algobattle && pip install . --user && cd .. |
30 | 22 | - name: Lint with flake8 |
31 | 23 | run: | |
32 | | - # stop the build if there are Python syntax errors or undefined names |
33 | | - flake8 . --count --exit-zero --select=E9,F63,F7,F82 --show-source --statistics --exclude algobattle |
34 | | - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
35 | | - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics \ |
36 | | - --per-file-ignores="__init__.py:F401,D104 */solver/main.py:D100 */generator/main.py:D100" \ |
37 | | - --docstring-convention numpy --ignore=D100,D105,D102,W503 --exclude algobattle |
38 | | - - name: Test with unittest |
| 24 | + flake8 . --count --max-complexity=10 --max-line-length=127 \ |
| 25 | + --per-file-ignores="__init__.py:F401,D104 */solver_execution_error/main.py:E999 \ |
| 26 | + */generator_execution_error/main.py:E999 match.py:E221 setup.py:D102,D100 \ |
| 27 | + */verifier.py:D102 */parser.py:D102 tests/*:D102 tests/__init__.py:D104 \ |
| 28 | + scripts/battle:E501,C901" \ |
| 29 | + --docstring-convention numpy --show-source --statistics --ignore=D105,D401,W503 |
| 30 | +
|
| 31 | + test: |
| 32 | + runs-on: ubuntu-latest |
| 33 | + steps: |
| 34 | + - uses: actions/checkout@v2 |
| 35 | + - name: Set up Python 3.6 |
| 36 | + uses: actions/setup-python@v2 |
| 37 | + with: |
| 38 | + python-version: 3.6 |
| 39 | + - name: Test using unittests |
39 | 40 | run: | |
| 41 | + git clone https://github.com/Benezivas/algobattle.git |
| 42 | + cd algobattle && pip install . --user && cd .. |
40 | 43 | python -m unittest |
| 44 | +
|
| 45 | + execute: |
| 46 | + runs-on: ubuntu-latest |
| 47 | + steps: |
| 48 | + - uses: actions/checkout@v2 |
| 49 | + - name: Set up Python 3.6 |
| 50 | + uses: actions/setup-python@v2 |
| 51 | + with: |
| 52 | + python-version: 3.6 |
| 53 | + - name: Install dependencies |
| 54 | + run: | |
| 55 | + git clone https://github.com/Benezivas/algobattle.git |
| 56 | + cd algobattle && pip install . --user && cd .. |
| 57 | + - name: Run short battles with different options as a sanity check |
| 58 | + run: | |
| 59 | + $HOME/.local/bin/battle problems/biclique --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 60 | + $HOME/.local/bin/battle problems/c4subgraphiso --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 61 | + $HOME/.local/bin/battle problems/clusterediting --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 62 | + $HOME/.local/bin/battle problems/domset --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 63 | + $HOME/.local/bin/battle problems/hikers --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 64 | + $HOME/.local/bin/battle problems/oscm3 --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 65 | + $HOME/.local/bin/battle problems/pairsum --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 66 | + $HOME/.local/bin/battle problems/pathpacking --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
| 67 | + $HOME/.local/bin/battle problems/scheduling --verbose --iter_cap=10 --rounds=2 --no_overhead_calculation |
0 commit comments