-
Notifications
You must be signed in to change notification settings - Fork 105
88 lines (75 loc) · 2.83 KB
/
post_release.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: post_release
on:
workflow_dispatch:
workflow_run:
workflows: [ "release" ]
types:
- completed
jobs:
post_release:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' || github.event_name == 'workflow_dispatch'}}
steps:
- uses: actions/checkout@v4
- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
with:
key: "v2"
- name: Build binary
run: cargo build
- uses: addnab/docker-run-action@v3
name: Spin up Docker Container
with:
image: iggyrs/iggy:latest
options: -d -p 8090:8090
run: /iggy/iggy-server
- name: Wait till iggy-server has bound to TCP 8090 port
timeout-minutes: 1
run: |
while ! nc -z 127.0.0.1 8090; do
sleep 1
done
sleep 1
ss -tuln | grep :8090
- name: Test Benchmark - Send
timeout-minutes: 1
run: |
./target/debug/iggy-bench --skip-server-start --warmup-time 0s send --message-batches 100 --messages-per-batch 100 tcp --server-address 127.0.0.1:8090
- name: Test Benchmark - Poll
timeout-minutes: 1
run: |
./target/debug/iggy-bench --skip-server-start --warmup-time 0s poll --message-batches 100 --messages-per-batch 100 tcp --server-address 127.0.0.1:8090
- name: Test Benchmark - Send and Poll
timeout-minutes: 1
run: |
./target/debug/iggy-bench --skip-server-start --warmup-time 0s send-and-poll --message-batches 100 --messages-per-batch 100 tcp --server-address 127.0.0.1:8090
- name: Check if number of messages is correct
timeout-minutes: 1
run: |
STATS=$(./target/debug/iggy -u iggy -p iggy stats)
echo "$STATS"
MESSAGE_COUNT=$(./target/debug/iggy -u iggy -p iggy -q stats -o json | jq '.messages_count')
readonly EXPECTED_MESSAGE_COUNT=200000
if [ "$MESSAGE_COUNT" -ne "$EXPECTED_MESSAGE_COUNT" ]; then
echo "Expected message count to be $EXPECTED_MESSAGE_COUNT, but got $MESSAGE_COUNT"
exit 1
fi
- name: Clean up
run: docker rm -f iggy_container
finalize_post_release:
runs-on: ubuntu-latest
needs: [ post_release ]
if: always()
steps:
- uses: actions/checkout@v4
- name: Everything is fine
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Something went wrong
if: ${{ contains(needs.*.result, 'failure') && github.event_name == 'workflow_run' }}
uses: JasonEtco/create-an-issue@v2.9.2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_BOT_CONTEXT_STRING: "post release docker container test"
with:
filename: .github/BOT_ISSUE_TEMPLATE.md