-
Notifications
You must be signed in to change notification settings - Fork 1
49 lines (48 loc) · 1.46 KB
/
deploy.yml
File metadata and controls
49 lines (48 loc) · 1.46 KB
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
name: Deployment Workflow
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-20.04
strategy:
max-parallel: 4
matrix:
python-version: ["2.7", "3.6", "3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install black
pip install pytest
- name: Formatting with black
run: |
black ./src
- name: Run unit tests
run: python -m pytest --import-mode=append ./src/tests/
notify:
runs-on: ubuntu-20.04
if: always()
needs: build
steps:
- name: Send telegram notification
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: html
message: |
<b>${{ github.workflow }}</b>
<b>repository</b>: <a href="https://github.com/${{github.repository}}">${{github.repository}}</a>
<b>event</b>: ${{ github.event_name }}
<b>status</b>: ${{ needs.build.result }}
<b>details</b>: <a href="https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}">Click to view</a>