Skip to content

Commit

Permalink
try to fix CI
Browse files Browse the repository at this point in the history
  • Loading branch information
GirZ0n committed Feb 20, 2024
1 parent 89ed56c commit c2f5f36
Showing 1 changed file with 35 additions and 13 deletions.
48 changes: 35 additions & 13 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Python build
on: [push]

env:
POETRY_ENV_PATH: ~/poetry
POETRY_HOME: ~/poetry
POETRY_VERSION: 1.7.1
JETBRAINS_MONO_VERSION: 2.304
PYTHON_VERSION: "3.8"
Expand All @@ -28,14 +28,26 @@ jobs:
id: poetry-cache
uses: actions/cache@v3
with:
path: ${{ env.POETRY_ENV_PATH }}
path: ${{ env.POETRY_HOME }}
key: ${{ runner.os }}-poetry-cache-${{ env.POETRY_VERSION }}

- name: Install Poetry
if: steps.poetry-cache.outputs.cache-hit != 'true'
run: |
python3 -m venv $POETRY_ENV_PATH
$POETRY_ENV_PATH/bin/pip3 install poetry==$POETRY_VERSION
python3 -m venv $POETRY_HOME
$POETRY_HOME/bin/pip3 install poetry==$POETRY_VERSION
- name: Cache virtual environment
id: pip-cache
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./poetry.lock') }}

- name: Install requirements
if: steps.pip-cache.outputs.cache-hit != 'true'
run: |
$POETRY_HOME/bin/poetry install
code-style:
needs: setup
Expand All @@ -54,15 +66,20 @@ jobs:
id: poetry-cache
uses: actions/cache@v3
with:
path: ${{ env.POETRY_ENV_PATH }}
path: ${{ env.POETRY_HOME }}
key: ${{ runner.os }}-poetry-cache-${{ env.POETRY_VERSION }}

- name: Cache virtual environment
id: pip-cache
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./poetry.lock') }}

- name: Run Flake8
run: |
source $POETRY_ENV_PATH/bin/activate
poetry install
poetry run flake8 . --count --statistics --config ./.flake8
$POETRY_HOME/bin/poetry run flake8 . --count --statistics --config ./.flake8
- name: Run Black
uses: psf/black@stable
with:
Expand All @@ -89,9 +106,16 @@ jobs:
id: poetry-cache
uses: actions/cache@v3
with:
path: ${{ env.POETRY_ENV_PATH }}
path: ${{ env.POETRY_HOME }}
key: ${{ runner.os }}-poetry-cache-${{ env.POETRY_VERSION }}

- name: Cache virtual environment
id: pip-cache
uses: actions/cache@v3
with:
path: ./.venv
key: ${{ runner.os }}-pip-cache-${{ hashFiles('./poetry.lock') }}

- name: Download JetBrains Mono
run: |
curl -sLO https://github.com/JetBrains/JetBrainsMono/releases/download/v$JETBRAINS_MONO_VERSION/JetBrainsMono-$JETBRAINS_MONO_VERSION.zip
Expand All @@ -109,6 +133,4 @@ jobs:
- name: Test anderson
run: |
source $POETRY_ENV_PATH/bin/activate
poetry install
poetry run pytest . -vv
$POETRY_HOME/bin/poetry run pytest . -vv

0 comments on commit c2f5f36

Please sign in to comment.