From 5acc4da02a4a5c7eb51f598751d8c6f920c1502c Mon Sep 17 00:00:00 2001 From: Ben Felder Date: Thu, 23 Nov 2023 09:24:23 +0100 Subject: [PATCH] Add pytest workflow --- .github/workflows/pytest.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/pytest.yml diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml new file mode 100644 index 0000000..34bd287 --- /dev/null +++ b/.github/workflows/pytest.yml @@ -0,0 +1,36 @@ +name: Run Pytest on Pull Requests + +on: + pull_request: + branches: [main] + +jobs: + pytest: + runs-on: ubuntu-latest + + strategy: + matrix: + directory: ['game', 'monitor'] + + steps: + - name: Check out repository + uses: actions/checkout@v4 + + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + + - name: Install Poetry + run: curl -sSL https://install.python-poetry.org | python3 - + + - name: Install dependencies + run: | + cd ${{ matrix.directory }} + python -m pip install --upgrade pip + poetry install + + - name: Run pytest + run: | + cd ${{ matrix.directory }} + poetry run pytest