-
Notifications
You must be signed in to change notification settings - Fork 101
120 lines (101 loc) · 3.88 KB
/
backwards_compatibility.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
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: Print the event payload
run: cat "$GITHUB_EVENT_PATH"
- name: Check for BREAKING_CHANGE in commit message
id: check_commit
run: |
BREAKING_CHANGE_FOUND=false
for COMMIT in $(git log --format=%H HEAD^..HEAD); do
COMMIT_MSG=$(git log --format=%B -n 1 $COMMIT)
echo "Commit message: $COMMIT_MSG"
if echo "$COMMIT_MSG" | grep -q "BREAKING_CHANGE"; then
BREAKING_CHANGE_FOUND=true
break
fi
done
if $BREAKING_CHANGE_FOUND; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "skip=true, 'BREAKING_CHANGE' found in commit message"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "skip=false, 'BREAKING_CHANGE' not found in commit message"
fi
- name: Check for BREAKING_CHANGE in pull request body
id: check_pr_body
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_MSG_BODY=${{ github.event.pull_request.body }}
echo "Pull Request body: $PR_MSG_BODY"
if [[ "$PR_MSG_BODY" == *"BREAKING_CHANGE"* ]]; then
echo "skip=true" >> $GITHUB_OUTPUT
echo "skip=true, 'BREAKING_CHANGE' found in pull request body"
else
echo "skip=false" >> $GITHUB_OUTPUT
echo "skip=false, 'BREAKING_CHANGE' not found in pull request body"
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 }}"
- run: echo "${{ needs.check_commit_message.outputs.should_skip }}"
- 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;