-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (31 loc) · 1.01 KB
/
backend.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
name: Backend
on: [push, pull_request]
jobs:
test-lint-and-format:
name: Backend test, lint and format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: 3.11
- name: Install dependencies
run: |
cd backend
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: End-to-end test
run: |
set -x
cd backend
CORS_ORIGINS='' MEDIA=.. flask --app src/app.py run &
while [[ -z "${DIR_LIST:-}" ]]; do DIR_LIST=$(curl 'http://127.0.0.1:5000/?dir=' || true); done
echo "$DIR_LIST" | grep '{"name":".gitignore","type":"file","url":"/.gitignore"}'
echo "$DIR_LIST" | grep '{"name":"backend","type":"directory","url":"/backend"}'
- name: Lint
run: |
pylint $(git ls-files '*.py')
- name: Format
run: |
black . --check