From c4eaca0cf12a2f257ef8b6fef3b26851f0cdc169 Mon Sep 17 00:00:00 2001 From: Rock Storm Date: Sat, 14 Oct 2023 19:17:12 +0200 Subject: [PATCH] ci: Add GitHub workflow for automated testing --- .github/workflows/test.yml | 44 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 000000000..169ad7bc5 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,44 @@ +# This workflow will install Python dependencies and perform testing + +name: Test Printrun + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] + include: + # Currently, unit testing requires Python 3.11+ + - unit-test: false + - python-version: "3.11" + unit-test: true + - python-version: "3.12" + unit-test: true + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install -r requirements.txt + + - name: Perform functional tests + run: | + ./pronterface.py -h + + - name: Perform unit tests + if: ${{ matrix.unit-test }} + run: | + python -m unittest discover tests