Skip to content

updating estimates api #28

updating estimates api

updating estimates api #28

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: Run Python Tests with Pytest
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ main, test, local-miguel ]
pull_request:
branches: [ main, test, local-miguel ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Install Python 3
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: set up mysql
uses: mirromutth/mysql-action@v1.1
with:
mysql root password: 'test_psw'
# - name: change mysql root password encryption
# run: |
# mysql -u root -p test_psw
# Runs a set of commands using the runners shell
- name: Install Python Packages
run: |
cd flask
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: create database tables
run: python create_test_db.py
- name: create .env file
run: |
cd flask
touch .env
echo "FLASK_APP=app.py" >> .env
echo "FLASK_ENV=development" >> .env
echo "SECRET_KEY=test_key" >> .env
echo "DB_USER=root" >> .env
echo DB_PASSWORD=test_psw >> .env
echo DB_HOST=127.0.0.1 >> .env
echo DB=test_db >> .env
- name: create mysql.ini file
run: |
cd flask
touch mysql.ini
echo "[mysql]" >> mysql.ini
echo "host=127.0.0.1" >> mysql.ini
echo "user=root" >> mysql.ini
echo "password=test_psw" >> mysql.ini
echo "db=test_db" >> mysql.ini
- name: Launch flask developpment server
run: |
cd flask
flask run &
- name: Run tests with Pytest
run: pytest