This repository was archived by the owner on Mar 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
61 lines (56 loc) · 1.66 KB
/
studio-code-checks.yaml
File metadata and controls
61 lines (56 loc) · 1.66 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
name: Studio code checks
on:
push:
branches:
- main
- develop
paths:
- 'components/studio/**'
pull_request:
branches:
- main
- develop
paths:
- 'components/studio/**'
release:
types: [published]
jobs:
build:
runs-on: ubuntu-20.04
env:
working-directory: ./components/studio
services:
postgres:
image: postgres
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
#Python version should be the same as the base image in Dockerfile
python-version: "3.8.10"
- name: Install dependencies
working-directory: ${{env.working-directory}}
run: |
python -m pip install --upgrade pip
pip install autopep8 isort
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
- name: Check Python imports
working-directory: ${{env.working-directory}}
run: |
isort . --check --diff --skip migrations
- name: Check Python formatting
working-directory: ${{env.working-directory}}
run: |
autopep8 . --recursive --diff --exclude="migrations, deployments"
- name: Test with django test framework
working-directory: ${{env.working-directory}}
run: |
python manage.py test -v 2