Add backwards compatibility workflow for PRs #3
Workflow file for this run
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: 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: | |
- 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 "should_skip=true" >> $GITHUB_OUTPUT | |
else | |
echo "should_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: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Cache cargo & target directories | |
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 (code from PR) | |
run: cargo build | |
- name: Run bench (code from PR) | |
run: cargo run --bin iggy-bench -- send --message-batches 50 --messages-per-batch 50 tcp | |
- name: Build (origin/master) | |
run: git reset --hard origin/master && cargo build | |
- name: Run send bench (origin/master) | |
run: cargo run --bin iggy-bench -- send --message-batches 50 --messages-per-batch 50 tcp | |
- name: Run poll bench (origin/master) | |
run: cargo run --bin iggy-bench -- poll --message-batches 50 --messages-per-batch 50 tcp |