Skip to content

Commit

Permalink
Move poetry setup to a different job
Browse files Browse the repository at this point in the history
  • Loading branch information
Privat33r-dev committed Apr 30, 2024
1 parent ce1f47a commit 6bea19a
Showing 1 changed file with 22 additions and 29 deletions.
51 changes: 22 additions & 29 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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 }}
Expand Down Expand Up @@ -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: |
Expand Down

0 comments on commit 6bea19a

Please sign in to comment.