From afd6012731a3f30abaaf29f97cc4710c6bf1ba1a Mon Sep 17 00:00:00 2001 From: Leif Denby Date: Wed, 22 May 2024 14:11:21 +0200 Subject: [PATCH] add cicd testing workflow --- .github/workflows/ci-tests.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/ci-tests.yml diff --git a/.github/workflows/ci-tests.yml b/.github/workflows/ci-tests.yml new file mode 100644 index 00000000..9b73f298 --- /dev/null +++ b/.github/workflows/ci-tests.yml @@ -0,0 +1,33 @@ +# cicd workflow for running tests with pytest +# needs to first install pdm, then install torch cpu manually and then install the package +# then run the tests + +name: tests (cpu) + +on: [push, pull_request] + +jobs: + tests: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Install pdm + uses: pdm-project/setup-pdm@v4 + with: + python-version: "3.10" + cache: true + + - name: Install torch (CPU) + run: | + python -m pip install torch --index-url https://download.pytorch.org/whl/cpu + + - name: Install package (including dev dependencies) + run: | + pdm install + pdm install --dev + + - name: Run tests + run: | + pdm run pytest