Skip to content

Commit

Permalink
Merge branch 'master' into dependabot/cargo/rustls-pemfile-2.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
spetz authored Mar 2, 2024
2 parents 812feca + d79746c commit 0535c17
Show file tree
Hide file tree
Showing 3 changed files with 116 additions and 23 deletions.
104 changes: 104 additions & 0 deletions .github/workflows/backwards_compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: backwards_compatibility
on:
pull_request:
branches:
- master
types: [opened, synchronize, reopened]

jobs:
check_commit_message:
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.check_commit.outputs.skip || steps.check_pr_body.outputs.skip }}
steps:
- uses: actions/checkout@v4

- name: Check for BREAKING_CHANGE in commit message
id: check_commit
run: |
COMMIT_MSG=$(git log --format=%B -n 1 HEAD)
echo "Commit message: $COMMIT_MSG"
if echo "$COMMIT_MSG" | grep -q "BREAKING_CHANGE"; then
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
- name: Check for BREAKING_CHANGE in pull request body
id: check_pr_body
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_MSG_TITLE=$(jq -r .pull_request.title "$GITHUB_EVENT_PATH")
PR_MSG_BODY=$(jq -r .pull_request.body "$GITHUB_EVENT_PATH")
echo "Pull Request body: $PR_MSG_BODY"
if [[ "$PR_MSG_BODY" == *"BREAKING_CHANGE"* ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
else
echo "skip=false" >> $GITHUB_OUTPUT
fi
build_and_test:
runs-on: ubuntu-latest
needs: check_commit_message
if: ${{ needs.check_commit_message.outputs.should_skip != 'true' }}
steps:
- run: echo "${{ needs.check_commit_message.outputs.should_skip }}"

- uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
fetch-depth: 0

- name: Cache cargo & target directories
uses: Swatinem/rust-cache@v2
with:
key: "v2"

- name: Build (PR)
run: cargo build

- uses: JarvusInnovations/background-action@v1
name: Run iggy-server in background (PR)
with:
run: |
target/debug/iggy-server &
wait-on: tcp:localhost:8090
wait-for: 1m
tail: true

- name: Run send bench (PR)
timeout-minutes: 1
run: target/debug/iggy-bench --warmup-time 0 --verbose send --message-batches 25 --messages-per-batch 25 tcp

- name: Stop iggy-server
timeout-minutes: 1
run: pkill iggy-server && while pgrep -l iggy-server; do sleep 1; done;

- name: Reset to origin/master
run: git reset --hard origin/master

- name: Build (origin/master)
run: cargo build

- uses: JarvusInnovations/background-action@v1
name: Run iggy-server in background (origin/master)
with:
run: |
target/debug/iggy-server &
wait-on: tcp:localhost:8090
wait-for: 1m
tail: true

- name: Run poll bench (origin/master)
timeout-minutes: 1
run: target/debug/iggy-bench --warmup-time 0 --verbose poll --message-batches 25 --messages-per-batch 25 tcp

- name: Run send bench (origin/master)
timeout-minutes: 1
run: target/debug/iggy-bench --warmup-time 0 --verbose send --message-batches 25 --messages-per-batch 25 tcp

- name: Stop iggy-server
timeout-minutes: 1
run: pkill iggy-server && while pgrep -l iggy-server; do sleep 1; done;

23 changes: 6 additions & 17 deletions .github/workflows/post_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,29 +15,18 @@ jobs:
uses: Swatinem/rust-cache@v2
with:
key: "v2"
- name: Install musl-tools, gnome-keyring and keyutils on Linux
run: |
sudo apt-get update --yes && sudo apt-get install --yes musl-tools gnome-keyring keyutils
rm -f $HOME/.local/share/keyrings/*
echo -n "test" | gnome-keyring-daemon --unlock
- name: Build binary
uses: houseabsolute/actions-rust-cross@v0
with:
command: "build"
target: x86_64-unknown-linux-musl
args: "--verbose --release --package bench"
run: cargo build
- name: Spin up Docker Container
run: docker run -d -p 8090:8090 --name iggy_container iggyrs/iggy
- name: Test Benchmark
run: |
send_output=$(timeout 1s ./target/x86_64-unknown-linux-musl/release/iggy-bench send tcp --server-address 127.0.0.1:8090 2>&1) || send_code=$?;
poll_output=$(timeout 1s ./target/x86_64-unknown-linux-musl/release/iggy-bench poll tcp --server-address 127.0.0.1:8090 2>&1) || poll_code=$?;
send_poll_output=$(timeout 1s ./target/x86_64-unknown-linux-musl/release/iggy-bench send-and-poll tcp --server-address 127.0.0.1:8090 2>&1) || send_poll_code=$?;
send_output=$(timeout 5s ./target/debug/iggy-bench send tcp --server-address 127.0.0.1:8090 2>&1) || send_code=$?;
poll_output=$(timeout 5s ./target/debug/release/iggy-bench poll tcp --server-address 127.0.0.1:8090 2>&1) || poll_code=$?;
send_poll_output=$(timeout 5s ./target/debug/iggy-bench send-and-poll tcp --server-address 127.0.0.1:8090 2>&1) || send_poll_code=$?;
expected_send_lines=("Producer #1 → preparing the test messages..."
"Producer #1 → sending 1000000 messages in 1000 batches of 1000 messages...")
expected_poll_lines=("Consumer #1 → preparing the test messages..."
"Consumer #1 → polling 1000000 messages in 1000 batches of 1000 messages...")
expected_send_lines=("Producer #1 → sending 1000000 messages in 1000 batches of 1000 messages...")
expected_poll_lines=("Consumer #1 → polling 1000000 messages in 1000 batches of 1000 messages...")
expected_send_poll_lines=("${expected_send_lines[@]}"
"${expected_poll_lines[@]}")
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/sanity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,18 +64,18 @@ jobs:
check-commit-message:
name: Validate commit messages
runs-on: ubuntu-latest
# This action isn't working with workflow_dispatch, so we need to skip it
# This action isn't working with workflow_dispatch, skip it
if: github.event_name != 'workflow_dispatch'
steps:
- name: Check subject line length
uses: gsactions/commit-message-checker@v2
with:
excludeDescription: 'true' # exclude description body of a pull request
excludeTitle: 'true' # exclude the title of a pull request
checkAllCommitMessages: 'true' # checks all commits associated with the pull request
excludeDescription: 'false' # exclude description body of a pull request
excludeTitle: 'false' # exclude the title of a pull request
checkAllCommitMessages: 'false' # checks all commits associated with the pull request
accessToken: ${{ secrets.GITHUB_TOKEN }} # needed only when checkAllCommitMessages is true
pattern: '^.{0,90}(\n.*)*$'
error: 'Subject of all commits in the PR has to be shorter than 90 characters.'
pattern: '^.{0,80}(\n.*)*$'
error: 'Subject of all commits in the PR and PR body/title has to be shorter than 80 characters.'

- name: Disallow specific prefixes in title
uses: gsactions/commit-message-checker@v2
Expand Down

0 comments on commit 0535c17

Please sign in to comment.