-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (75 loc) · 2.18 KB
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
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