(backend/CI) added dev-dependencies section #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [dev, main] | |
pull_request: | |
branches: [main] | |
jobs: | |
frontend: | |
name: Frontend Lint & Test | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: travian/frontend | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: "18" | |
- name: Install Dependencies | |
run: npm install | |
- name: Lint | |
run: npm run lint | |
backend: | |
name: Backend Lint & Test. | |
runs-on: ubuntu-latest | |
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: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
- name: Configure Poetry in PATH | |
run: echo "${HOME}/.local/bin" >> $GITHUB_PATH | |
- name: Configure Poetry Settings | |
run: poetry config virtualenvs.in-project true | |
- 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: Install Dependencies with Poetry | |
run: poetry install -vv | |
- name: Lint | |
run: poetry run flake8 . | |
check-quality: | |
name: Quality Checks | |
runs-on: ubuntu-latest | |
needs: backend | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v3 | |
- name: Run Bandit | |
run: poetry run bandit -r src/ | |
- name: Run Black | |
run: poetry run black --check . | |
- name: Run Flake8 | |
run: poetry run flake8 . | |
- name: Run Isort | |
run: poetry run isort --check-only . | |
- name: Run Safety | |
run: poetry run safety check |