From 6666daffdb4922f0d16f0bf0cd57e989bdfebbba Mon Sep 17 00:00:00 2001 From: Rapha <25059996+sdrapha@users.noreply.github.com> Date: Mon, 8 May 2023 22:30:05 -0400 Subject: [PATCH] Create github actions for automated validation --- .github/workflows/tests.yml | 58 +++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..954983a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,58 @@ +name: Tests + +on: + workflow_dispatch: + push: + pull_request: + +jobs: + Validation: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v3 + - name: 'Use Python 3.8' + uses: actions/setup-python@v4 + with: + python-version: '3.8' + - run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + name: 'Install dependencies' + - run: | + pip install flake8 flake8-docstrings + flake8 src/pyvesync + name: 'Flake8' + - run: | + pip install pylint + pylint src/pyvesync + name: 'Pylint' + - run: | + pip install mypy + mypy src/pyvesync + python3 -m pip install types-requests + name: 'MyPy' + + pytest: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: + - '3.8' + - '3.9' + - '3.10' + - '3.11' + steps: + - name: 'Use Python ${{matrix.python-version}}' + uses: actions/setup-python@v4 + with: + python-version: ${{matrix.python-version}} + - run: | + set -e + python -m pip install --upgrade pip + pip install -r requirements.txt + pip install pytest pytest-sugar pyyaml + name: 'Install dependencies' + - run: | + pytest --junitxml=reports/pytest.xml + name: 'Run Tests' \ No newline at end of file