Skip to content

Update check workflow #25

Update check workflow

Update check workflow #25

Workflow file for this run

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:
PROJECT_TITLE: Inclusive Dance Bot
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
steps:
- name: Send notify
run: |
curl "http://188.225.87.124/message?token=${{ secrets.GOTIFY_APP_TOKEN }}" \
-F "title=${{ env.PROJECT_TITLE }}" \
-F "message=Checked ${{ github.REF_NAME }}\n${{ github.SERVER_URL }}/${{ github.REPOSITORY }}/actions/runs/${{ github.RUN_ID }}" \
-F "priority=2"