Skip to content

Commit

Permalink
(fix) flake8 file
Browse files Browse the repository at this point in the history
  • Loading branch information
Pierre-Alexandre35 committed Oct 28, 2024
1 parent fec5e05 commit e383e1a
Showing 1 changed file with 16 additions and 53 deletions.
69 changes: 16 additions & 53 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ jobs:
- name: Lint
run: npm run lint

setup:
name: Backend Environment Setup
backend:
name: Backend Lint & Test
runs-on: ubuntu-latest
defaults:
run:
Expand Down Expand Up @@ -64,58 +64,18 @@ jobs:
- name: Install Dependencies with Poetry
run: poetry install -vv

- name: Save Poetry Cache Directory
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-pypoetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pypoetry-
backend:
name: Backend Lint & Test
runs-on: ubuntu-latest
needs: setup
defaults:
run:
working-directory: travian/backend
steps:
- name: Checkout Code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Restore Poetry Cache Directory
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-pypoetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-pypoetry-
- name: Install Poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: Configure Poetry in PATH
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH

- name: Cache Poetry and Dependencies
uses: actions/cache@v3
with:
path: .venv
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Capture Execution Environment
id: poetry_env
run: poetry env info --path

- name: Set up In-Project Virtual Environment
run: poetry config virtualenvs.in-project true
- name: Export Main-Only Requirements
run: poetry export --only main --without-hashes --output /tmp/requirements.txt

- name: Install Dependencies with Poetry
run: poetry install -vv
- name: Install Requirements in Virtual Environment
run: pip install -r /tmp/requirements.txt
env:
VIRTUAL_ENV: ${{ steps.poetry_env.outputs.stdout }}
PATH: ${{ steps.poetry_env.outputs.stdout }}/bin:$PATH

- name: Lint
run: poetry run flake8 --exclude .venv
Expand All @@ -130,4 +90,7 @@ jobs:
run: poetry run flake8 --exclude .venv

- name: Run Isort
run: poetry run isort --check-only --skip .venv src/
run: poetry run isort --check-only --skip .venv

- name: Run Safety
run: poetry run safety check

0 comments on commit e383e1a

Please sign in to comment.