From 071324d1a79b6bae0708be1b65ce4f3ee2c30d0b Mon Sep 17 00:00:00 2001 From: kedhammar Date: Fri, 31 May 2024 09:19:42 +0000 Subject: [PATCH] add gha for running pytest --- .github/workflows/test-code.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/test-code.yml diff --git a/.github/workflows/test-code.yml b/.github/workflows/test-code.yml new file mode 100644 index 0000000..b813d10 --- /dev/null +++ b/.github/workflows/test-code.yml @@ -0,0 +1,25 @@ +name: test-code +on: [push, pull_request] + +# Cancel if a newer run is started +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + # Use pytest to run tests + pytest: + runs-on: ubuntu-latest + steps: + - name: Checkout repo + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install pytest + - name: pytest --> Run tests + run: pytest .