Skip to content

Add README files and .gitignore for task0 design, and update main REA… #89

Add README files and .gitignore for task0 design, and update main REA…

Add README files and .gitignore for task0 design, and update main REA… #89

Workflow file for this run

name: Python CI with SQLite
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.10'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r Correction_Part3_HBnB/hbnb/requirements.txt
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install Flask==2.3.2 Flask-RESTX==1.1.0 Werkzeug==2.3.7
pip install -r Correction_Part3_HBnB/hbnb/requirements.txt
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install --force-reinstall -r Correction_Part3_HBnB/hbnb/requirements.txt
# pip freeze
- name: Vérifier l'installation de SQLite
run: sqlite3 --version
- name: Créer la base de données SQLite
run: |
sqlite3 test.db < Correction_Part3_HBnB/hbnb/schema.sql
# - name: Ajouter des données de test
# run: |
# sqlite3 test.db <<EOF
# INSERT INTO users (id, first_name, last_name, email, password, is_admin)
# VALUES (
# '36c9050e-ddd3-4c3b-9731-9f487208bbc1',
# 'Admin',
# 'HBnB',
# '[email protected]',
# '$2a$12$ivDzHW.L7rqFI4ymAdVBbOswoVX4zsrfE1B1a5mnW.Yxt6e7ZKYoW',
# TRUE
# );
# EOF
# - name: Run tests
# working-directory: Correction_Part3_HBnB/hbnb
# run: pytest --cov=app
# - name: Run tests with coverage
# env:
# PYTHONPATH: ${{ github.workspace }}/Correction_Part3_HBnB/hbnb
# working-directory: Correction_Part3_HBnB/hbnb
# run: pytest app/tests --cov=app --cov-report=term-missing
- name: Update pytest plugins
run: |
pip install --upgrade pytest pytest-flask pytest-cov
- name: Run tests with coverage
env:
PYTHONWARNINGS: "ignore::pluggy.PluggyTeardownRaisedWarning"
PYTHONPATH: ${{ github.workspace }}/Correction_Part3_HBnB/hbnb
working-directory: ${{ github.workspace }}/Correction_Part3_HBnB/hbnb
run: pytest app/tests --cov=app --cov-report=term-missing -rw -vv
# name: Python CI
# on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main
# jobs:
# test:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout code
# uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip
# pip install -r Correction_Part3_HBnB/hbnb/requirements.txt
# - name: Vérifier l'installation de SQLite
# run: sqlite3 --version
# - name: Créer la base de données SQLite
# run: |
# sqlite3 test.db < Correction_Part3_HBnB/hbnb/schema.sql
# - name: Ajouter des données de test
# run: |
# sqlite3 test.db <<EOF
# INSERT INTO users (id, first_name, last_name, email, password, is_admin)
# VALUES (
# '36c9050e-ddd3-4c3b-9731-9f487208bbc1',
# 'Admin',
# 'HBnB',
# '[email protected]',
# '$2a$12$ivDzHW.L7rqFI4ymAdVBbOswoVX4zsrfE1B1a5mnW.Yxt6e7ZKYoW',
# TRUE
# );
# EOF
# - name: Run tests
# working-directory: Correction_Part3_HBnB/hbnb
# run: pytest --cov=app
# - name: Setup SQLite Database for Tests
# run: |
# cd Correction_Part3_HBnB
# touch test.db
# python -c "from app import db; db.create_all()"
# - name: Run tests
# working-directory: Correction_Part3_HBnB/hbnb
# run: |
# pytest --cov=app