-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (69 loc) · 3.03 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
name: CI
on:
push:
branches:
- '**'
tags:
- '[0-9]+.[0-9]+.[0-9]+'
permissions:
contents: read
jobs:
pre-commit-hook:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- name: Install pre-commit
run: python -m pip install pre-commit
shell: bash
- name: Show pre-commit requirements
run: python -m pip freeze --local
shell: bash
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
- name: Run pre-commit for all files
run: pre-commit run --config './.pre-commit-config.yaml' --all-files --color=always --show-diff-on-failure
shell: bash
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 --project-directory datastore --profile test build
- name: Start docker stack
run: DYNAMICTIME=false LOTIME=1000-01-01T00:00:00Z HITIME=9999-12-31T23:59:59Z docker compose --project-directory datastore up -d
- name: Test loader runs without errors
run: DYNAMICTIME=false LOTIME=1000-01-01T00:00:00Z HITIME=9999-12-31T23:59:59Z docker compose --project-directory datastore run --rm loader
- name: Integration test
run: DYNAMICTIME=false LOTIME=1000-01-01T00:00:00Z HITIME=9999-12-31T23:59:59Z docker compose --project-directory datastore run --rm integration
- name: Test client runs without errors
run: DYNAMICTIME=false LOTIME=1000-01-01T00:00:00Z HITIME=9999-12-31T23:59:59Z docker compose --project-directory datastore run --rm client
- name: Run load test
run: |
python --version
pip install -r datastore/load-test/requirements.txt
python -m grpc_tools.protoc --proto_path=datastore/datastore/protobuf datastore.proto --python_out=datastore/load-test --grpc_python_out=datastore/load-test
locust -f datastore/load-test/locustfile_write.py,datastore/load-test/locustfile_read.py --headless -u 5 -r 1 --run-time 300 --only-summary --csv datastore/load-test/store
- name: Archive load test artifacts
uses: actions/upload-artifact@v3
with:
name: performance
path: datastore/load-test/store_*.csv
- name: Print results
run: |
pip install csvkit
echo "## Stats" >> $GITHUB_STEP_SUMMARY
csvlook datastore/load-test/store_stats.csv >> $GITHUB_STEP_SUMMARY
echo "## Stats history" >> $GITHUB_STEP_SUMMARY
csvlook datastore/load-test/store_stats_history.csv >> $GITHUB_STEP_SUMMARY
echo "## Failures" >> $GITHUB_STEP_SUMMARY
csvlook datastore/load-test/store_failures.csv >> $GITHUB_STEP_SUMMARY
- name: Cleanup
if: always()
run: docker compose --project-directory datastore down --volumes