chore(deps-dev): bump vitest from 2.1.5 to 2.1.6 #6398
Workflow file for this run
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: Test | |
on: | |
pull_request: | |
types: [opened, reopened, synchronize, edited] | |
workflow_call: | |
env: | |
DJANGO_SECRET_KEY: n0t5os3cre7-${{ github.sha }} | |
EMAIL_HOST: localhost | |
EMAIL_PORT: 1025 | |
EMAIL_HOST_USER: | |
EMAIL_HOST_PASSWORD: | |
EMAIL_USE_TLS: false | |
DEFAULT_FROM_EMAIL: h@ll.o | |
SITE_URL: http://localhost:8000 | |
PYTHON_VERSION: 3.11.2 | |
jobs: | |
python-checks: | |
runs-on: ubuntu-22.04 | |
steps: | |
# -- block install -- | |
- uses: actions/checkout@v2 | |
- name: Use the cached python install for dev requirements | |
uses: actions/cache@v2 | |
id: python-cache | |
with: | |
path: /opt/hostedtoolcache/Python/${{ env.PYTHON_VERSION }} | |
key: ${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/dev.txt', 'requirements/base.txt') }} | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dev requirements | |
if: steps.python-cache.outputs.cache-hit != 'true' | |
run: pip install -r requirements/dev.txt | |
# -- endblock install -- | |
- name: Install GNU gettext | |
run: sudo apt install gettext | |
- name: Pylint check | |
run: python -m pylint $(find . -type f -path '*.py' -not -path '*/migrations*') | |
- name: Black check | |
run: python -m black --check . | |
- name: Isort check | |
run: python -m isort --check . | |
- name: Flake8 check with mccabe complexity 10 | |
run: python -m flake8 --max-complexity 10 . | |
- name: Check no migration is missing | |
run: ./manage.py makemigrations --check --dry-run | |
- name: Check no makemessages translation is missing | |
run: | | |
./manage.py makemessages --all --verbosity 0 --no-location --no-obsolete | |
git diff -I'^"PO' --exit-code locale/*/LC_MESSAGES/django.po # Fail if any change apart from headers. | |
git checkout -- locale/*/LC_MESSAGES/django.po | |
./manage.py makemessages --all --verbosity 0 --no-obsolete --no-location -d djangojs --ignore 'node_modules/*' --ignore 'venv/*' --ignore 'euphrosyne/assets/dist/*' -e js,tsx,ts,jsx | |
git diff -I'^"PO' --exit-code locale/*/LC_MESSAGES/djangojs.po # Fail if any change apart from headers. | |
git checkout -- locale/*/LC_MESSAGES/djangojs.po | |
- name: Check no translation is empty | |
run: | | |
# Inspired from https://blog.erw.dk/2015/06/06/checks-for-your-django-project/ | |
missing_translations=$(sed '$a\\' locale/*/LC_MESSAGES/django.po | tac | sed '/^$/N;/\nmsgstr ""$/,/^msgid/!d' | tac) | |
[ $(wc -l <(echo $missing_translations) | cut -d ' ' -f1) = '1' ] | |
- name: Run mypy on selected folders | |
run: | | |
python -m mypy . | |
python-tests: | |
runs-on: ubuntu-22.04 | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_PASSWORD: password | |
POSTGRES_DB: euphrosyne | |
POSTGRES_USER: euphrosyne | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
# -- block install -- | |
- uses: actions/checkout@v2 | |
- name: Use the cached python install for dev requirements | |
uses: actions/cache@v2 | |
id: python-cache | |
with: | |
path: /opt/hostedtoolcache/Python/${{ env.PYTHON_VERSION }} | |
key: ${{ runner.os }}-python-${{ env.PYTHON_VERSION }}-${{ hashFiles('requirements/dev.txt', 'requirements/base.txt') }} | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_VERSION }} | |
- name: Install dev requirements | |
if: steps.python-cache.outputs.cache-hit != 'true' | |
run: pip install -r requirements/dev.txt | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: Install modules | |
run: npm ci | |
- name: Build files with webpack | |
run: npm run build | |
# -- endblock install -- | |
- name: Collect static files | |
run: rm -rf _static && python manage.py collectstatic --clear --noinput | |
- name: Pytest | |
run: python -m pytest . | |
env: | |
DB_HOST: localhost | |
DB_USER: euphrosyne | |
DB_PORT: 5432 | |
DB_PASSWORD: password | |
DB_NAME: euphrosyne | |
frontend-tests: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-node@v2 | |
with: | |
node-version: 20 | |
cache: "npm" | |
- name: Install modules | |
run: npm install | |
- name: Run eslint | |
run: npx eslint . | |
- name: Check Prettier | |
run: npx prettier -c $(git ls-files | grep -E '\.(js|json|yaml)$') | |
- name: Run tsc | |
run: npm run lint:tsc | |
- name: Run tests | |
run: npm run test |