From ed8a4c2cc211bde78c3ec05c24ef185d1aa50afe Mon Sep 17 00:00:00 2001 From: Privat33r-dev Date: Tue, 30 Apr 2024 02:00:36 +0200 Subject: [PATCH] Move poetry setup to a different job --- .github/workflows/tests.yml | 51 ++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 29 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2c92dc9..eb6b110 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -1,12 +1,5 @@ name: tests -env: - PYTHON_VERSION: "3.10" - NODE_VERSION: "20" - MODULE_NAME: clairvoyance - MIN_TEST_COV: 0 - SERVER: http://localhost:4000 - on: push: paths-ignore: @@ -23,49 +16,50 @@ on: branches: - main +env: + PYTHON_VERSION: "3.10" + NODE_VERSION: "20" + MODULE_NAME: clairvoyance + MIN_TEST_COV: 0 + SERVER: http://localhost:4000 + permissions: contents: read jobs: unit-tests: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + - name: Install and configurate poetry + run: | + pipx install poetry + poetry config virtualenvs.in-project true - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} cache: 'poetry' - - name: Install dependencies - run: | - pip install poetry - name: Setup poetry - run: | - poetry config virtualenvs.in-project true - poetry install + run: poetry install - name: Run tests run: | source .venv/bin/activate pytest --cov=$MODULE_NAME --cov-report=xml --cov-fail-under=$MIN_TEST_COV tests system-tests: - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 + - name: Install and configurate poetry + run: | + pipx install poetry + poetry config virtualenvs.in-project true - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} cache: 'poetry' - - name: Install dependencies - run: | - pip install poetry - name: Setup poetry - run: | - poetry config virtualenvs.in-project true - poetry install + run: poetry install - uses: actions/setup-node@v4 with: node-version: ${{ env.NODE_VERSION }} @@ -101,17 +95,16 @@ jobs: if: false steps: - uses: actions/checkout@v4 + - name: Install and configurate poetry + run: | + pipx install poetry + poetry config virtualenvs.in-project true - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_VERSION }} cache: 'poetry' - - name: Install dependencies - run: | - pip install poetry - name: Setup poetry - run: | - poetry config virtualenvs.in-project true - poetry install + run: poetry install - name: Run lint if: always() run: |