-
Notifications
You must be signed in to change notification settings - Fork 12
88 lines (88 loc) · 2.47 KB
/
build.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
name: Build
on:
- push
- pull_request
jobs:
lint:
if: github.event_name == 'push' && !startsWith(github.event.ref, 'refs/tags')
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Flake8 & mypy
run: python -m pip install --upgrade flake8-intsights mypy;
- name: Check Flake8 Linting Errors
if: "!contains(github.event.head_commit.message, 'skip flake8')"
run: flake8
- name: Check mypy Linting Errors
if: "!contains(github.event.head_commit.message, 'skip mypy')"
run: mypy --install-types --non-interactive --ignore-missing-imports -p sergeant
test:
runs-on: ${{ matrix.os }}
needs: lint
strategy:
fail-fast: false
matrix:
python-version:
- '3.7'
- '3.8'
- '3.9'
- '3.10'
- '3.11'
os:
- ubuntu-latest
services:
redis-node-one:
image: redis
ports:
- '6379:6379'
redis-node-two:
image: redis
ports:
- '6380:6379'
mongo-node-one:
image: 'bitnami/mongodb:latest'
ports:
- '27017:27017'
env:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_NAME: test_replica_set_one
MONGODB_PORT_NUMBER: 27017
ALLOW_EMPTY_PASSWORD: yes
MONGODB_ADVERTISED_HOSTNAME: localhost
mongo-node-two:
image: 'bitnami/mongodb:latest'
ports:
- '27018:27018'
env:
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_NAME: test_replica_set_two
MONGODB_PORT_NUMBER: 27018
ALLOW_EMPTY_PASSWORD: yes
MONGODB_ADVERTISED_HOSTNAME: localhost
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Install dependencies
run: poetry install
- name: Test
run: poetry run pytest