From eb3eafe3689b360e25ed16de0e185f8ff7afaa59 Mon Sep 17 00:00:00 2001 From: Shorouq Date: Sun, 9 Jun 2024 18:43:35 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20Add=20tests=20to=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/run_tests.yml | 38 +++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/run_tests.yml diff --git a/.github/workflows/run_tests.yml b/.github/workflows/run_tests.yml new file mode 100644 index 000000000..c90052ba4 --- /dev/null +++ b/.github/workflows/run_tests.yml @@ -0,0 +1,38 @@ +name: Run Unit Tests via Pytest + +on: + push: + pull_request: + branches: + - main + +jobs: + deploy: + name: Create Release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + with: + fetch-depth: 0 + - name: Set up Python 3.11 + uses: actions/setup-python@v2.3.1 + with: + python-version: 3.11 + - id: cache-dependencies + name: Cache dependencies + uses: actions/cache@v2.1.7 + with: + path: ${{ github.workspace }}/.venv + key: dependencies-${{ hashFiles('**/poetry.lock') }} + restore-keys: dependencies- + - name: Install dependencies + if: steps.cache-dependencies.cache-hit != 'true' + run: | + python3 -m pip install -U pip poetry + poetry --version + poetry check --no-interaction + poetry config virtualenvs.in-project true + poetry install --no-interaction + - name: Run tests + run: | + poetry run pytest -ra -s -o log_cli=true Database/tests \ No newline at end of file