From d02270979ac8514a3416776390585c400dfe57de Mon Sep 17 00:00:00 2001 From: Viktor Karlquist Date: Thu, 7 Dec 2023 06:59:13 +0000 Subject: [PATCH] Added pytests to workflow --- .github/workflows/python-tests.yml | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/python-tests.yml diff --git a/.github/workflows/python-tests.yml b/.github/workflows/python-tests.yml new file mode 100644 index 0000000..1e75ca9 --- /dev/null +++ b/.github/workflows/python-tests.yml @@ -0,0 +1,33 @@ +--- + # This workflow will install Python dependencies and run tests with a single version of Python + # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python + + name: Python tests + + on: + push: + # Run against all branches + # branches: [ "main" ] + pull_request: + branches: ["main"] + + permissions: + contents: read + + jobs: + # Inspired by https://github.com/actions/setup-python/blob/main/docs/advanced-usage.md#caching-packages + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Install poetry + run: pipx install poetry + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + cache: 'poetry' + - name: Install dependencies + run: poetry install + - name: Run tests + run: poetry run pytest \ No newline at end of file