Merge pull request #390 from Happy-Algorithms-League/enh/faster-mutate #283
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: run tests | |
on: | |
push: | |
branches: | |
- master | |
pull_request: | |
branches: | |
- master | |
jobs: | |
hal-cgp-testsuite: | |
name: hal-cgp testsuite | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
dep: ['[all]', '[dev]'] | |
exclude: | |
- python-version: 3.7 | |
dep: "[dev]" | |
- python-version: 3.8 | |
dep: "[dev]" | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
cache: pip | |
cache-dependency-path: | | |
requirements.txt | |
extra-requirements.txt | |
- name: Install pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install library and dependencies | |
env: | |
DEP: ${{ matrix.dep }} | |
run: | | |
pip --version | |
pip install --upgrade -e .$DEP | |
pip install --upgrade pytest-cov coveralls | |
- name: Run code checks (black) | |
run: | | |
black --version | |
black --check . | |
- name: Run code checks (flake8) | |
run: | | |
flake8 --version | |
flake8 --config=.flake8 . | |
- name: Run code checks (mypy) | |
run: | | |
mypy --version | |
mypy cgp | |
- name: Run code checks (isort) | |
run: | | |
isort --version | |
isort --check-only cgp examples test | |
- name: Run tests | |
run: | | |
pytest --version | |
pytest --cov=cgp | |
- name: Build documentation | |
run: | | |
make -C docs/ html-examples-short | |
if: matrix.python-version == 3.8 && matrix.dep == '[all]' | |
- name: Run coveralls | |
uses: AndreMiras/coveralls-python-action@develop | |
with: | |
parallel: true | |
flag-name: Test suite | |
if: matrix.python-version == 3.8 && matrix.dep == '[all]' |