Improve Git Version Parsing/Checking and Added mypy
#273
Workflow file for this run
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: Tests | |
on: | |
pull_request: | |
branches: | |
- main | |
paths-ignore: | |
- '**/README.md' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
jobs: | |
unit-tests: | |
name: Unit Tests | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.8 | |
uses: actions/setup-python@v3 | |
with: | |
python-version: '3.8' | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
- name: Install Python dependencies | |
run: poetry install | |
- name: Linter | |
run: | | |
# Lint via flake8 | |
printf "Running flake8 linter -------->\n" | |
printf "flake8 count for E9,F63,F7,F82: " | |
poetry run flake8 ./mkdocs_multirepo_plugin --count --select=E9,F63,F7,F82 --show-source --statistics | |
printf "flake8 count for max-complexity=10: " | |
poetry run flake8 ./mkdocs_multirepo_plugin --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Unittests | |
run: poetry run python3 -m unittest tests.unittests -v | |
integration-tests: | |
needs: unit-tests | |
name: Python ${{ matrix.python-version }} and Git ${{ matrix.git-version }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.8, 3.9, '3.10', '3.11'] | |
git-version: [2.17.0, 2.35.0, 2.37.1] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v3 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install Git ${{ matrix.git-version }} from Source | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y dh-autoreconf libcurl4-gnutls-dev libexpat1-dev gettext libz-dev libssl-dev install-info unzip | |
sudo apt-get -y install docbook2x | |
wget https://github.com/git/git/archive/refs/tags/v${{ matrix.git-version }}.zip && unzip v${{ matrix.git-version }}.zip | |
cd git-${{ matrix.git-version }} | |
make configure | |
./configure --prefix=/usr | |
make all | |
sudo make install | |
git --version | |
- name: Install Bats | |
run: ./__tests__/setup-bats.sh | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-in-project: true | |
- name: Install Package and Integration Test Deps | |
run: | | |
poetry build | |
pip install ./dist/*.whl | |
pip install -r integration-requirements.txt | |
- name: Integration Tests | |
run: ./__tests__/test-bats-ci.sh |