Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI Build
on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
container: python:3.9-slim

services:
postgres:
image: postgres:alpine
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: pgs3cr3t
POSTGRES_DB: testdb
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
pip install -r requirements.txt

- name: Lint with flake8
run: |
flake8 service --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 service --count --max-complexity=10 --max-line-length=127 --statistics

- name: Run unit tests with nose
run: nosetests
env:
DATABASE_URI: "postgresql://postgres:pgs3cr3t@postgres:5432/testdb"
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# DevOps Capstone Template

![Build Status](https://github.com/daniel-learns-with-coursera/devops-capstone-project/actions/workflows/ci-build.yaml/badge.svg)

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![Python 3.9](https://img.shields.io/badge/Python-3.9-green.svg)](https://shields.io/)

Expand Down
Loading