-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (61 loc) · 2.2 KB
/
on-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
name: On Pull Request
on:
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
new-python-protobuf: ["true"]
include:
- python-version: "3.7"
new-python-protobuf: "false"
services:
redis:
image: redis
ports:
- 6379:6379
env:
TEST_AUTH_TOKEN: ${{ secrets.ALPHA_TEST_AUTH_TOKEN }}
TEST_CACHE_NAME: python-integration-test-${{ matrix.python-version }}-${{ matrix.new-python-protobuf }}-${{ github.sha }}
steps:
- uses: actions/checkout@v3
- name: Commitlint and Other Shared Build Steps
uses: momentohq/standards-and-practices/github-actions/shared-build@gh-actions-v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Verify README generation
uses: momentohq/standards-and-practices/github-actions/oss-readme-template@gh-actions-v1
with:
project_status: official
project_stability: alpha
project_type: other
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Bootstrap poetry
run: |
curl -sL https://install.python-poetry.org | python - -y --version 1.3.1
- name: Configure poetry
run: poetry config virtualenvs.in-project true
- name: Install dependencies
run: poetry install
- name: Install Old Protobuf
# Exercises the wire types generated against the old protobuf library
if: matrix.new-python-protobuf == 'false'
run: poetry add "protobuf<3.20"
- name: Run mypy
# mypy has inconsistencies between 3.7 and the rest; default to lowest common denominator
if: matrix.python-version == '3.7'
run: poetry run mypy src tests
- name: Run flake8
run: poetry run flake8 src tests
- name: Run black
run: poetry run black src tests --check --diff
- name: Run isort
run: poetry run isort . --check --diff
- name: Run tests
run: poetry run pytest -p no:sugar -q