Skip to content

Commit

Permalink
CI: Add linting jobs (#643)
Browse files Browse the repository at this point in the history
* lint: Add linting command to package.json

* ci: Add linting step to GitHub Actions workflow

* refactor: Rename test to CI & minor formatting

* ci: Also configure backend linting

* deps: Add flake8 to dev requirements

* ci: Add names to test jobs

* ci: Add continue-on-error flag to backend-lint job
  • Loading branch information
drikusroor authored Dec 11, 2023
1 parent 8629832 commit 339cda4
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 20 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test suite

on:
push:

jobs:

backend-test:
name: Test Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Backend Tests
run: sudo docker-compose --env-file .env-github-actions run server bash -c "python manage.py test"

backend-lint:
name: Lint Backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Lint Backend
continue-on-error: true
run: sudo docker-compose --env-file .env-github-actions run server bash -c "flake8"

frontend-test:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run Frontend Tests
run: sudo docker-compose --env-file .env-github-actions run client yarn test --watchAll=false

frontend-lint:
name: Lint Frontend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: sudo docker-compose --env-file .env-github-actions run client yarn lint
19 changes: 0 additions & 19 deletions .github/workflows/test.yml

This file was deleted.

2 changes: 2 additions & 0 deletions backend/requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ django-debug-toolbar==3.2.2
# via -r requirements.in/dev.txt
django-inline-actions==2.4.0
# via -r requirements.in/base.txt
flake8==4.0.1
# via -r requirements.in/dev.txt
idna==3.3
# via requests
iptocc==2.1.2
Expand Down
3 changes: 2 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
"scss-watch": "sass src/index.scss src/index.css; sass --watch src/index.scss src/index.css",
"storybook": "REACT_APP_API_ROOT=http://localhost:8000 && storybook dev -p 6006",
"storybook:build": "storybook build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
"lint:ts": "eslint . --ext .js,.jsx,.ts,.tsx",
"lint": "eslint src/**/*.js"
},
"eslintConfig": {
"extends": [
Expand Down

0 comments on commit 339cda4

Please sign in to comment.