post_publish_server #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: post_publish_server | |
on: | |
workflow_dispatch: | |
workflow_run: | |
workflows: [ "publish_server" ] | |
types: | |
- completed | |
jobs: | |
post_publish_server: | |
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 - Producer | |
timeout-minutes: 1 | |
run: | | |
./target/debug/iggy-bench --skip-server-start --message-batches 100 --messages-per-batch 100 pinned-producer tcp --server-address 127.0.0.1:8090 | |
- name: Test Benchmark - Consumer | |
timeout-minutes: 1 | |
run: | | |
./target/debug/iggy-bench --skip-server-start --message-batches 100 --messages-per-batch 100 pinned-consumer tcp --server-address 127.0.0.1:8090 | |
- name: Test Benchmark - Producer and Consumer | |
timeout-minutes: 1 | |
run: | | |
./target/debug/iggy-bench --skip-server-start --message-batches 100 --messages-per-batch 100 pinned-producer-and-consumer 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=160000 | |
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_publish_server: | |
runs-on: ubuntu-latest | |
needs: [ post_publish_server ] | |
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/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
GITHUB_BOT_CONTEXT_STRING: "post release docker container test" | |
with: | |
filename: .github/BOT_ISSUE_TEMPLATE.md |