Skip to content

Commit

Permalink
Create Github action testing backend
Browse files Browse the repository at this point in the history
  • Loading branch information
demccormack committed Oct 14, 2023
1 parent f2227df commit 0d2c776
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 1 deletion.
34 changes: 34 additions & 0 deletions .github/workflows/backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Backend

on: [push, pull_request]

jobs:
backend:
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
2 changes: 1 addition & 1 deletion .github/workflows/frontend.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:
pull-requests: read

jobs:
test-lint-and-format:
frontend:
name: Frontend test, lint and format
runs-on: ubuntu-latest

Expand Down

0 comments on commit 0d2c776

Please sign in to comment.