-
Notifications
You must be signed in to change notification settings - Fork 4
57 lines (45 loc) · 1.53 KB
/
pull-request.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
name: Pull Request
on:
push:
branches:
- main #todo - remove
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
jobs:
test:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
name: Unit Tests and Linting
env:
FLAGSMITH_API_URL: https://api.flagsmith.com/api/v1
FLAGSMITH_API_TOKEN: test_token
ENVIRONMENT_API_KEYS: placeholder_key1
services:
redis:
image: redis:7.0.7
ports: ["6379:6379"]
strategy:
max-parallel: 4
matrix:
python-version: ["3.12"]
steps:
- name: Cloning repo
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pip download
uses: syphar/restore-pip-download-cache@v1
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Check black formatting
run: black --check .
- name: Check flake8 linting
run: flake8 --config=.flake8 .
- name: Check import order
run: isort --check .
- name: Run Tests
run: pytest -p no:warnings