Thanks to visit codestin.com
Credit goes to github.com

Skip to content

add gitattributes

add gitattributes #213

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
SECRET_KEY: django-insecure-ci-k8m2p9x4q7w5n3h6j1v8c0z2b5a4y7t1r9e3u6i8o0p2s4d6f8g
DEBUG: "True"
GITHUB_ACTIONS: "true"
DB_HOST: localhost
DB_PORT: "5432"
DB_NAME: airbcar_db
DB_USER: airbcar_user
DB_PASSWORD: amineamine
DJANGO_SETTINGS_MODULE: config.settings_ci_simple
jobs:
build-and-test:
runs-on: ubuntu-latest
env:
SECRET_KEY: django-insecure-ci-k8m2p9x4q7w5n3h6j1v8c0z2b5a4y7t1r9e3u6i8o0p2s4d6f8g
DEBUG: "True"
GITHUB_ACTIONS: "true"
DB_HOST: localhost
DB_PORT: "5432"
DB_NAME: airbcar_db
DB_USER: airbcar_user
DB_PASSWORD: amineamine
DJANGO_SETTINGS_MODULE: config.settings_ci_simple
services:
db:
image: postgres:15
env:
POSTGRES_DB: airbcar_db
POSTGRES_USER: airbcar_user
POSTGRES_PASSWORD: amineamine
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.8'
- name: Install PostgreSQL client
run: sudo apt-get update && sudo apt-get install -y postgresql-client
- name: Wait for Postgres
run: |
until pg_isready -h localhost -p 5432; do sleep 1; done
- name: Install backend dependencies
run: |
cd backend
pip install -r requirements.txt
- name: Run database migrations
run: |
cd backend
python manage.py migrate
- name: Run backend tests
run: |
cd backend
python manage.py test
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install frontend dependencies
run: |
cd frontend
npm install --legacy-peer-deps
- name: Run frontend linting (non-blocking)
run: |
cd frontend
npm run lint || true
- name: Run frontend build
run: |
cd frontend
npm run build
env:
ESLINT_NO_DEV_ERRORS: true
CI: false