Skip to content

Update dependencies #2121

Update dependencies

Update dependencies #2121

Workflow file for this run

name: Lint and test
on:
push:
branches:
- main
pull_request:
env:
POETRY_VERSION: "1.6.1"
NODE_VERSION: "16"
PYTHON_VERSION: "3.11"
jobs:
test-python:
runs-on: ubuntu-latest
# TODO: fix postgresql tests, oidc_provider fails
# services:
# db:
# image: postgres:latest
# environment:
# POSTGRES_USER: postgres
# POSTGRES_DB: onlineweb4
# POSTGRES_PASSWORD: postgres
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache python packages
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: pip install poetry==${{ env.POETRY_VERSION }}
- name: Install python dependencies
run: poetry install --no-interaction --no-ansi
- name: Install node dependencies
run: yarn install --pure-lockfile
- name: npm build
run: npm run build:prod
- name: Python tests
env:
OW4_DJANGO_STRIPE_PUBLIC_KEY_ARRKOM: ${{ secrets.STRIPE_PUBLIC_KEY_ARRKOM }}
OW4_DJANGO_STRIPE_PUBLIC_KEY_PROKOM: ${{ secrets.STRIPE_PUBLIC_KEY_PROKOM }}
OW4_DJANGO_STRIPE_PUBLIC_KEY_TRIKOM: ${{ secrets.STRIPE_PUBLIC_KEY_TRIKOM }}
OW4_DJANGO_STRIPE_PRIVATE_KEY_ARRKOM: ${{ secrets.STRIPE_PRIVATE_KEY_ARRKOM }}
OW4_DJANGO_STRIPE_PRIVATE_KEY_PROKOM: ${{ secrets.STRIPE_PRIVATE_KEY_PROKOM }}
OW4_DJANGO_STRIPE_PRIVATE_KEY_TRIKOM: ${{ secrets.STRIPE_PRIVATE_KEY_TRIKOM }}
# TODO: see service todo
# DATABASE_URL: postgres://postgres:postgres@db:5432/onlineweb4
run: poetry run tox -e tests
- uses: codecov/codecov-action@v2
lint-python:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache python packages
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: pip install poetry==${{ env.POETRY_VERSION }}
- name: Install python dependencies
run: poetry install --no-interaction --no-ansi
- name: Python linting
run: poetry run tox -e flake8 -e isort -e black
django-checks:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Cache python packages
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry
key: ${{ runner.os }}-poetry-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-poetry-
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Install Poetry
run: pip install poetry==${{ env.POETRY_VERSION }}
- name: Install python dependencies
run: poetry install --no-interaction --no-ansi
- name: Check migrations
run: poetry run python manage.py makemigrations --check
- name: Django check
run: poetry run python manage.py check
lint-js:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
cache: 'yarn'
- name: Install node dependencies
run: yarn install --pure-lockfile
- name: JS linting
run: npm run lint-js
- name: less linting
run: npm run lint-less