From 78b503239eedb464a58758de2ca99f13565f1d82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Thu, 2 Jul 2020 18:33:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=E2=80=8D=EF=B8=8F=20CI/CD:=20Add?= =?UTF-8?q?=20pytest=20&=20flake8=20to=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/cicd.yml | 40 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cicd.yml b/.github/workflows/cicd.yml index 83f8e1900..eefb2c512 100644 --- a/.github/workflows/cicd.yml +++ b/.github/workflows/cicd.yml @@ -28,8 +28,43 @@ jobs: name: dist path: dist + test-unit: + name: ๐Ÿงช Unit tests + strategy: + matrix: + python: ["2.7", "3.7", "3.8"] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: ๐Ÿ— Set up Python ${{ matrix.python }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python }} + - name: ๐Ÿ— Set up test dependencies + run: | + pip install -e .[develop] + - name: ๐Ÿš€ Run test suite + run: | + pytest + + test-flake8: + name: ๐Ÿงช Flake8 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: ๐Ÿ— Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + - name: ๐Ÿ— Set up test dependencies + run: | + pip install -e .[develop] + - name: ๐Ÿš€ Run test suite + run: | + flake8 src/ tests setup.py + test-install: - name: ๐Ÿงช Test install + name: ๐Ÿงช Installation tests needs: build strategy: matrix: @@ -56,7 +91,7 @@ jobs: pip install dist/OctoPrint-*.tar.gz test-e2e: - name: ๐Ÿงช Test E2E + name: ๐Ÿงช E2E tests needs: build runs-on: ubuntu-16.04 steps: @@ -106,6 +141,7 @@ jobs: name: ๐Ÿ“ฆ Publish on TestPyPI if: github.event_name == 'release' needs: + - test-unit - test-install - test-e2e runs-on: ubuntu-latest