Skip to content

Add backwards compatibility workflow for PRs #1

Add backwards compatibility workflow for PRs

Add backwards compatibility workflow for PRs #1

name: backwards_compatibility
on:
workflow_call:
pull_request:
branches:
- master
types: [opened, synchronize, reopened]
jobs:
build_and_test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for BREAKING_CHANGE in commit message
id: check_commit
run: |
echo "COMMIT_MSG=$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
if echo "$COMMIT_MSG" | grep -q "BREAKING_CHANGE"; then
echo "SKIP=true" >> $GITHUB_ENV
else
echo "SKIP=false" >> $GITHUB_ENV
fi
- name: Skip the workflow if BREAKING_CHANGE is found
if: ${{ env.SKIP }} == 'true'
uses: actions/github-script@v5
with:
script: |
github.actions.cancelWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId
});
console.log("Workflow skipped due to BREAKING_CHANGE in commit message");
- 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