From 93c982c93acc119662c2f7d2eeb2be92945cd7ee Mon Sep 17 00:00:00 2001 From: ReRubis <74458287+ReRubis@users.noreply.github.com> Date: Wed, 17 Jan 2024 21:09:07 +0400 Subject: [PATCH] Add tests workflow Create a workflow for testing --- .github/workflows/tests.yml | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..5ced03a --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,44 @@ +name: Python Test Workflow + +on: + push: + branches: + - main + pull_request: + branches: + - main + workflow_dispatch: + +permissions: + contents: read + +concurrency: + # The workflow run is canceled if a run on the same branch or pull request is in progress + group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}" + cancel-in-progress: true + +jobs: + test: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.12"] + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: pdm-project/setup-pdm@v3 + with: + python-version: ${{ matrix.python-version }} + cache: true + + - name: Install dependencies + run: | + pdm sync + + - name: Run pytest + run: | + pdm run pytest