-
-
Notifications
You must be signed in to change notification settings - Fork 1
87 lines (83 loc) · 2.56 KB
/
Copy pathautomated-testing.yml
File metadata and controls
87 lines (83 loc) · 2.56 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
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
name: Automated testing
on:
schedule:
- cron: "0 4 * * *"
push:
pull_request:
workflow_dispatch:
jobs:
unit_tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Unit tests
run: poetry run task test
env:
CONFIG_FILE: "config-test.json"
integration_tests:
if: |
github.event_name == 'schedule'
|| ( github.event_name == 'push' && github.ref == 'refs/heads/master' )
|| ( github.event_name == 'pull_request' && github.event.pull_request.base.ref == 'master' )
runs-on: ubuntu-20.04
concurrency: telegram_tests
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Unit tests
run: poetry run task test
env:
CONFIG_FILE: "config-test.json"
- name: Cleanup subscription config
run: rm subscriptions.json
- name: Site integration tests
run: poetry run task test_site_integration
env:
E621_USERNAME: ${{ secrets.E621_USERNAME }}
E621_API_KEY: ${{ secrets.E621_API_KEY }}
- name: Telegram integration tests
run: poetry run task test_telegram_integration
env:
BOT_KEY: ${{ secrets.BOT_KEY }}
CLIENT_API_HASH: ${{ secrets.CLIENT_API_HASH }}
CLIENT_API_ID: ${{ secrets.CLIENT_API_ID }}
CLIENT_SESSION_STRING: ${{ secrets.CLIENT_SESSION_STRING }}
E621_USERNAME: ${{ secrets.E621_USERNAME }}
E621_API_KEY: ${{ secrets.E621_API_KEY }}
CONFIG_FILE: "config-test.json"
linting:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install poetry
poetry install
- name: Flake8 check
run: poetry run flake8 fa_search_bot
- name: Mypy
run: poetry run mypy fa_search_bot
- name: Isort
run: poetry run isort fa_search_bot --check