Skip to content

feat: deploy app to gcp #1293

feat: deploy app to gcp

feat: deploy app to gcp #1293

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
name: Test
on:
push:
pull_request:
env:
FLASK_ENV: testing
jobs:
build:
runs-on: ubuntu-20.04
services:
postgres:
image: postgres:12
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${{ secrets.TEST_DATABASE_PASSWORD }}
POSTGRES_DB: ${{ secrets.TEST_DATABASE_NAME }}
POSTGRES_HOST_AUTH_METHOD: trust
options:
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
ports:
- 5432:5432
mongo:
image: mongo:4.2.3
env:
MONGO_INITDB_ROOT_USERNAME: crane
MONGO_INITDB_ROOT_PASSWORD: ${{ secrets.TEST_MONGO_PASSWORD }}
ports:
- 27017:27017
strategy:
matrix:
python-version: ["3.6", "3.7", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Test with pytest
env:
TEST_DATABASE_URI: ${{ secrets.TEST_DATABASE_URI }}
TEST_MONGO_URI: ${{ secrets.TEST_MONGO_URI }}
run: |
python -m pytest
- name: Generate Report
env:
TEST_DATABASE_URI: ${{ secrets.TEST_DATABASE_URI }}
TEST_MONGO_URI: ${{ secrets.TEST_MONGO_URI }}
run: |
pip install coverage
coverage run -m pytest