Complete #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check project in all branches | |
on: | |
workflow_call: | |
push: | |
branches-ignore: | |
- master | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
env: | |
APP_PG_DB_NAME: test_db | |
APP_PG_DSN: postgresql+asyncpg://pguser:pguser@postgres:5432/test_db | |
APP_BASE_PG_DSN: postgresql+asyncpg://pguser:pguser@postgres:5432/postgres | |
jobs: | |
checking: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup python 3.11 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
- name: Install dependencies | |
run: make develop | |
- name: Run flake8 | |
run: make flake | |
- name: Run black | |
run: make black | |
- name: Run bandit | |
run: make bandit | |
- name: Run mypy | |
run: make mypy | |
test: | |
name: Run service tests with pytest | |
runs-on: ubuntu-22.04 | |
container: python:3.11 | |
needs: checking | |
services: | |
postgres: | |
image: postgres:15 | |
env: | |
TZ: UTC | |
POSTGRES_USER: pguser | |
POSTGRES_PASSWORD: pguser | |
POSTGRES_DB: ${{ env.APP_PG_DB_NAME }} | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: make develop | |
- name: Run pytest | |
run: make test-ci | |
notify: | |
name: Notify successful CI | |
needs: test | |
runs-on: ubuntu-22.04 | |
env: | |
GOTIFY_HOST: ${{ secrets.GOTIFY_HOST }} | |
GOTIFY_APP_TOKEN: ${{ secrets.GOTIFY_APP_TOKEN }} | |
GOTIFY_TITLE: Inclusive Dance Bot | |
GOTIFY_MESSAGE: Checked repo ${{ github.REF_NAME }} | |
GOTIFY_EVENT_NAME: ${{ github.EVENT_NAME }} | |
GOTIFY_REPOSITORY_URL: ${{ github.SERVER_URL }}/${{ github.REPOSITORY }} | |
GOTIFY_ACTION_URL: ${{ github.SERVER_URL }}/${{ github.REPOSITORY }}/actions/runs/${{ github.RUN_ID }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Send notify | |
run: python ./gotify.py |