-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (89 loc) · 2.96 KB
/
ci.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: CI
on:
push:
branches:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
env:
LINE_LENGTH: 99 # TODO: would we like to increase this to 120?
jobs:
docker-lint-hadolint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: hadolint/[email protected]
with:
recursive: true
python-lint-black:
runs-on: ubuntu-latest
steps:
- name: Checkout Source
uses: actions/checkout@v3
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64
- name: Install Black
run: pip install black
- name: Lint Python with Black
run: black . --check --line-length=${LINE_LENGTH}
python-lint-flake8:
runs-on: ubuntu-latest
steps:
- name: Python Setup
uses: actions/setup-python@v4
with:
python-version: '3.11'
architecture: x64
- name: Checkout Source
uses: actions/checkout@v3
- name: Install flake8
run: pip install flake8
- name: Syntax Error Check
run: flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- name: Code Style Check
run: flake8 . --count --max-line-length=$LINE_LENGTH --ignore=W503 --show-source --statistics
test:
runs-on: ubuntu-latest
steps:
- name: Check out the repo
uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Build docker containers
run: docker compose --profile test build
- name: Start docker stack
run: docker compose up -d
- name: Test loader runs without errors
run: docker compose run --rm loader
- name: Integration test
run: docker compose run --rm integration
- name: Test client runs without errors
run: docker compose run --rm client
- name: Run load test
run: |
python --version
pip install -r load-test/requirements.txt
python -m grpc_tools.protoc --proto_path=datastore/protobuf datastore.proto --python_out=load-test --grpc_python_out=load-test
cd load-test
locust --headless -u 5 -r 1 --run-time 60 --only-summary --csv store
- name: Archive load test artifacts
uses: actions/upload-artifact@v3
with:
name: performance
path: load-test/store_*.csv
- name: Print results
run: |
pip install csvkit
echo "## Stats" >> $GITHUB_STEP_SUMMARY
csvlook load-test/store_stats.csv >> $GITHUB_STEP_SUMMARY
echo "## Stats history" >> $GITHUB_STEP_SUMMARY
csvlook load-test/store_stats_history.csv >> $GITHUB_STEP_SUMMARY
echo "## Failures" >> $GITHUB_STEP_SUMMARY
csvlook load-test/store_failures.csv >> $GITHUB_STEP_SUMMARY
- name: Cleanup
if: always()
run: docker compose down --volumes