-
Notifications
You must be signed in to change notification settings - Fork 327
94 lines (85 loc) · 2.67 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: sanity checks on opened pull requests
on:
pull_request:
branches:
- main
- release/**
- feature/**
paths:
- 'aim/cli/**'
- 'aim/ext/**'
- 'aim/sdk/**'
- 'aim/web/api/**'
- 'aim/storage/**'
- 'aim/utils/**'
- '.github/workflows/pull-request.yml'
- 'tests/**'
- 'performance_tests/**'
- 'setup.py'
types:
- opened
- synchronize
- ready_for_review
- reopened
- edited
jobs:
validate-naming-convention:
name: Pull Request's title matches naming convention
runs-on: ubuntu-latest
steps:
- uses: deepakputhraya/action-pr-title@master
with:
regex: '^\[(?:feat|fix|doc|refactor|deprecation)\]\s[A-Z].*(?<!\.)$'
github_token: ${{ github.token }}
run-checks:
if: github.event.pull_request.draft == false && github.event.action != 'edited'
runs-on: ubuntu-latest
name: Run Unit-tests & Code-style checks
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: setup python
uses: actions/setup-python@v2
with:
python-version: '3.8'
architecture: x64
- name: install deps
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.dev.txt
python -m pip install -r tests/requirements.txt
- name: code style checks
run: |
set -e
ruff check .
ruff format . --check
- name: unit-tests
run: |
pytest --cov-report term --cov-branch --cov-fail-under=50 --cov=aim/web --cov=aim/storage --cov=aim/sdk tests
storage-performance-checks:
needs: run-checks
concurrency: perf-tests
runs-on: [self-hosted, performance-tests]
name: Performance tests
steps:
- name: checkout
uses: actions/checkout@v2
with:
ref: ${{ github.head_ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: install deps
run: |
python3 -m venv venv
. venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.dev.txt
python -m pip install -r performance_tests/requirements.txt
- name: perf tests
run: |
. venv/bin/activate
export AWS_ACCESS_KEY_ID=${{ secrets.AIM_LOGS_AWS_ACCESS_KEY_ID }}
export AWS_SECRET_ACCESS_KEY=${{ secrets.AIM_LOGS_AWS_SECRET_ACCESS_KEY }}
pytest performance_tests || pytest --lf performance_tests