Skip to content

Commit

Permalink
testing custom badge
Browse files Browse the repository at this point in the history
testing failed badge

testing failed badge 2

final changes
  • Loading branch information
vdesmond committed Apr 22, 2021
1 parent 4fa14e0 commit 3de2a3b
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 5 deletions.
28 changes: 26 additions & 2 deletions .github/workflows/schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,40 @@ name: Scheduled Heroku test

on:
schedule:
- cron: "0 3 * * *"
- cron: "0 0 * * *"

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Check status of API
id: api-status
uses: lakuapik/gh-actions-http-status@v1
with:
sites: '["yomomma-api.herokuapp.com/","yomomma-api.herokuapp.com/jokes","yomomma-api.herokuapp.com/search?query=doctor"]'
expected: '[200,200,200]'
continue-on-error: true

- name: Update badges on success
uses: RubbaBoy/BYOB@v1.2.0
if: steps.api-status.outcome == 'success'
with:
NAME: heroku
LABEL: 'API Status'
ICON: 'https://simpleicons.vercel.app/heroku/c9c3e6'
STATUS: 'Deployed'
COLOR: purple
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Update badges on fail
uses: RubbaBoy/BYOB@v1.2.0
if: steps.api-status.outcome != 'success'
with:
NAME: heroku
LABEL: 'API Status'
ICON: 'https://simpleicons.vercel.app/heroku/c9c3e6'
STATUS: 'Down'
COLOR: red
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,6 @@ jobs:
pip3 install -r requirements.txt
if: steps.cache-venv.outputs.cache-hit != 'true'

- name: Activate venv and Run Test
run: . venv/bin/activate && pytest app/test.py
- name: Activate venv and Run Test
id: api-test
run: . venv/bin/activate && pytest app/test.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# yomomma-apiv2
[![example workflow](https://github.com/beanboi7/yomomma-apiv2/actions/workflows/test.yml/badge.svg)](https://github.com/beanboi7/yomomma-apiv2/actions/workflows/test.yml)
[![Heroku](https://github.com/beanboi7/yomomma-apiv2/actions/workflows/schedule.yml/badge.svg)](https://yomomma-api.herokuapp.com/jokes/)
[![Heroku](https://byob.yarr.is/beanboi7/yomomma-apiv2/heroku/)](https://yomomma-api.herokuapp.com/jokes/)

**An API that insults yo momma**
<br />
Expand Down

0 comments on commit 3de2a3b

Please sign in to comment.