Run tests on CI push, gate deploy on them

This commit is contained in:
Christa Hartsock
2022-07-07 16:59:37 -07:00
parent 6a7e5aa776
commit db9fc27320
2 changed files with 50 additions and 50 deletions

View File

@@ -1,50 +1,50 @@
# name: Run checks
name: Run checks
# on: [push]
on: [push]
# permissions:
# contents: read
permissions:
contents: read
# jobs:
# build:
# runs-on: ubuntu-latest
jobs:
build:
runs-on: ubuntu-latest
# services:
# postgres:
# image: postgres
# env:
# POSTGRES_USER: user
# POSTGRES_PASSWORD: password
# POSTGRES_DB: test_notification_api
# options: >-
# --health-cmd pg_isready
# --health-interval 10s
# --health-timeout 5s
# --health-retries 5
# ports:
# # Maps tcp port 5432 on service container to the host
# - 5432:5432
services:
postgres:
image: postgres
env:
POSTGRES_USER: user
POSTGRES_PASSWORD: password
POSTGRES_DB: test_notification_api
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps tcp port 5432 on service container to the host
- 5432:5432
# steps:
# - name: Install container dependencies
# run: |
# sudo apt-get update \
# && sudo apt-get install -y --no-install-recommends \
# libcurl4-openssl-dev
# - uses: actions/checkout@v3
# - name: Set up Python 3.9
# uses: actions/setup-python@v3
# with:
# python-version: "3.9"
# - name: Install application dependencies
# run: make bootstrap
# env:
# SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
# # - name: Run style checks
# # run: flake8 .
# # - name: Check imports alphabetized
# # run: isort --check-only ./app ./tests
# - name: Run tests
# run: pytest -n4 --maxfail=10
# env:
# SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
steps:
- name: Install container dependencies
run: |
sudo apt-get update \
&& sudo apt-get install -y --no-install-recommends \
libcurl4-openssl-dev
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v3
with:
python-version: "3.9"
- name: Install application dependencies
run: make bootstrap
env:
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api
# - name: Run style checks
# run: flake8 .
# - name: Check imports alphabetized
# run: isort --check-only ./app ./tests
- name: Run tests
run: pytest -n4 --maxfail=10
env:
SQLALCHEMY_DATABASE_TEST_URI: postgresql://user:password@localhost:5432/test_notification_api

View File

@@ -1,10 +1,10 @@
name: Deploy to prototype environment
on: [push]
# workflow_run:
# workflows: [ Run checks ]
# types:
# - completed
on:
workflow_run:
workflows: [ Run checks ]
types:
- completed
# branches: [ main ]
permissions: