-
-
Notifications
You must be signed in to change notification settings - Fork 5
148 lines (136 loc) · 5.44 KB
/
push.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
name: Will it blend?
on: [push]
jobs:
type-checking:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ['3.8','3.11']
name: Type Checking + Linting ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
ssh-key: ${{ secrets.I18N_SUBMODULE_GH_ACTIONS_PULL }}
submodules: recursive
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: requirements.txt
- uses: actions/cache@v3
id: cache
with:
path: ~/venv
key: ${{ matrix.os }}-pip-lint-${{ hashfiles('requirements.txt') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv ~/venv
. ~/venv/bin/activate
pip install flake8
pip install -r requirements.txt
- name: Setup node.js
uses: actions/setup-node@v3
with:
node-version: '16'
- name: Check pyright
run: |
npm install pyright
cd "$GITHUB_WORKSPACE"
source ~/venv/bin/activate
npx pyright --venv-path ~/venv
- name: Lint with flake8
run: |
. ~/venv/bin/activate
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The Github editor is 127 chars wide
flake8 . --count --statistics --config=./setup.cfg
build:
runs-on: ${{ matrix.os }}
name: Launch check os ${{ matrix.os }}, Python ${{ matrix.python-version }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: [3.8]
steps:
- uses: actions/checkout@v3
with:
ssh-key: ${{ secrets.I18N_SUBMODULE_GH_ACTIONS_PULL }}
submodules: recursive
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: requirements.txt
- uses: actions/cache@v3
id: cache
with:
path: ~/venv
key: ${{ matrix.os }}-pip-pytest-${{ hashfiles('requirements.txt') }}
- name: Install dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: |
python -m venv ~/venv
. ~/venv/bin/activate
pip install pytest
pip install -r requirements.txt
- name: Install google key for translations
env:
PROJECT_ID: ${{ secrets.PROJECT_ID }}
PRIVATE_KEY_ID: ${{ secrets.PRIVATE_KEY_ID }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
CLIENT_EMAIL: ${{ secrets.CLIENT_EMAIL }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_CERT_URL: ${{ secrets.CLIENT_CERT_URL }}
run: |
. ~/venv/bin/activate
if ! [ -f friday-trans-key.json ]; then python create_trans_key.py; fi
if [ -f friday-trans-key.json ]; then printf "File created"; fi
- name: Test with pytest
env:
DBHOSTNAME: ${{ secrets.DBHOSTNAME }}
DBUSERNAME: ${{ secrets.DBUSERNAME }}
DBUSERNAMECANARY: ${{ secrets.DBUSERNAMECANARY }}
DBUSERNAMELOCAL: ${{ secrets.DBUSERNAMELOCAL }}
DBPASSWORD: ${{ secrets.DBPASSWORD }}
DBPASSWORDCANARY: ${{ secrets.DBPASSWORDCANARY }}
DBPASSWORDLOCAL: ${{ secrets.DBPASSWORDLOCAL }}
DBDATABASE: ${{ secrets.DBDATABASE }}
DBDATABASECANARY: ${{ secrets.DBDATABASECANARY }}
DBDATABASELOCAL: ${{ secrets.DBDATABASELOCAL }}
TOKENTEST: ${{ secrets.TOKENTEST }}
DBLWEBHOOKPASS: ${{ secrets.DBLWEBHOOKPASS }}
WEBHOOKSPAMID: ${{ secrets.WEBHOOKSPAMID }}
WEBHOOKISSUESID: ${{ secrets.WEBHOOKISSUESID }}
WEBHOOKINFOID: ${{ secrets.WEBHOOKINFOID }}
WEBHOOKERRORSID: ${{ secrets.WEBHOOKERRORSID }}
WEBHOOKCHATID: ${{ secrets.WEBHOOKCHATID }}
WEBHOOKJOINID: ${{ secrets.WEBHOOKJOINID }}
WEBHOOKSPAMTOKEN: ${{ secrets.WEBHOOKSPAMTOKEN }}
WEBHOOKISSUESTOKEN: ${{ secrets.WEBHOOKISSUESTOKEN }}
WEBHOOKINFOTOKEN: ${{ secrets.WEBHOOKINFOTOKEN }}
WEBHOOKERRORSTOKEN: ${{ secrets.WEBHOOKERRORSTOKEN }}
WEBHOOKCHATTOKEN: ${{ secrets.WEBHOOKCHATTOKEN }}
WEBHOOKJOINTOKEN: ${{ secrets.WEBHOOKJOINTOKEN }}
PROJECT_ID: ${{ secrets.PROJECT_ID }}
PRIVATE_KEY_ID: ${{ secrets.PRIVATE_KEY_ID }}
PRIVATE_KEY: ${{ secrets.PRIVATE_KEY }}
CLIENT_EMAIL: ${{ secrets.CLIENT_EMAIL }}
CLIENT_ID: ${{ secrets.CLIENT_ID }}
CLIENT_CERT_URL: ${{ secrets.CLIENT_CERT_URL }}
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }}
REDDITCLIENTID: ${{ secrets.REDDITCLIENTID }}
REDDITCLIENTSECRET: ${{ secrets.REDDITCLIENTSECRET }}
REDDITPASSWORD: ${{ secrets.REDDITPASSWORD }}
APIREQUESTS: ${{ secrets.APIREQUESTS }}
OPENAI: ${{ secrets.OPENAI }}
CROWDIN_KEY: ${{ secrets.CROWDIN_KEY }}
run: |
. ~/venv/bin/activate
if [ -f friday-trans-key.json ]; then printf "Google file here"; fi
pytest test_will_it_blend.py tests_offline/