Skip to content

Bump cross-spawn from 7.0.3 to 7.0.6 in /frontend (#181) #217

Bump cross-spawn from 7.0.3 to 7.0.6 in /frontend (#181)

Bump cross-spawn from 7.0.3 to 7.0.6 in /frontend (#181) #217

Workflow file for this run

name: Build & Test
on:
push:
branches: ["master"]
pull_request:
branches: ["master"]
env:
ENVIRONMENT: CI-test
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres
DJANGO_SETTINGS_MODULE: up.settings.production
MANUAL_PRODUCTION: True
SECRET_KEY: ${{ secrets.SECRET_KEY }}
GPR_TOKEN: ${{ secrets.GPR_TOKEN }}
jobs:
build_and_test:
name: Build & Test
runs-on: ubuntu-22.04
steps:
# priprav prostredi
- name: ☁️ Checkout repo
uses: actions/checkout@v4
- name: 🔧 Setup node
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "npm"
cache-dependency-path: "**/package-lock.json"
- name: 🔧 Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
cache: "pipenv"
# spust skripty pro upravu souboru
- name: 📝 Create .npmrc file
run: ./scripts/shell/ci/create_npmrc.sh
- name: 📝 Apply string substitution
run: ./scripts/shell/ci/string_substitution.sh
- name: 📝 Create dummy .env file
run: touch .env
# nainstaluj JS zavislosti
- name: 🔧 JS - install deps & build frontend app
run: npm ci
# nainstaluj Python zavislosti
- name: 🔧 Python - install deps
run: |
pip install pipenv
pipenv install --deploy --dev
# spust audit frontendu
- name: 🔍 JS - run audit
continue-on-error: true
run: npm run frontend:audit
# otestuj frontend (typy, linting, jest)
- name: 🔍 JS - run tests
run: npm run frontend:test
# TODO zapnout kontrolu typu na CI
# otestuj typy v backendu pres mypy
# - name: 🔍 Python - run tests
# run: mypy .
# PostgreSQL
# - build custom PSQL container image with CZ locale
# - and then start the PSQL service (tcp port 5432 on service container is mapped to the host)
# https://github.com/orgs/community/discussions/24923
- name: 📦 PostgreSQL - container build & run
run: source scripts/shell/postgresql_docker.sh
# priprav Django aplikaci
- name: 🔧 Python - build Django app (staticfiles & migration)
run: ./scripts/shell/release_tasks.sh
# spust Django deployment checklist
- name: 🔍 Python - run Django deployment checklist
env:
MANUAL_PRODUCTION: False
run: pipenv run python manage.py check --deploy --fail-level WARNING
- name: 🐞 Debug env log
run: |
node --version
npm --version
python --version
pipenv --version
firefox --version
geckodriver --version
docker exec postgresql_cz psql -U postgres -c "SHOW LC_COLLATE;"
docker exec postgresql_cz psql --version
docker exec postgresql_cz pg_config --version
# proved testy, spocitej pokryti kodu a posli ho do cloudu
- name: 🔍 Python - run tests
run: pipenv run coverage run -a manage.py test
- name: 🔍 Run E2E API tests
run: pipenv run coverage run -a manage.py behave --stage=api --format=progress3
- name: 🔍 Run E2E UI tests
run: pipenv run coverage run -a manage.py behave --stage=ui --format=progress3
- name: 📝 Generate test reports
run: |
pipenv run coverage report
pipenv run coverage xml
- name: ☁️ Upload code coverage
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
run: ./scripts/shell/ci/codecov_run.sh
# smazani dat z buildu, testovani a dokumentace
- name: 🧹 Cleanup project folder
run: ./scripts/shell/ci/cleanup.sh
# nastavime spravnou fly.io konfiguraci
- name: 🧹 Pre-deploy tasks Fly.io - config files
run: mv fly.test.toml fly.toml
# pripravime fly.io klienta pro deploy
- name: 🧹 Pre-deploy tasks Fly.io - client
uses: superfly/flyctl-actions/setup-flyctl@master
# nasazeni testing verze na Fly.io
- name: 🚀 Deploy to test Fly.io
if: ${{ github.actor != 'dependabot[bot]' }}
run: flyctl deploy --remote-only
env:
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN_TEST }}