Skip to content

Commit 8d97a9e

Browse files
committed
ci: streamline workflows; remove tagged release workflow
Signed-off-by: NotAShelf <[email protected]> Change-Id: I1432980533dee11b64a53d2ad2f2094d6a6a6964
1 parent 48c3807 commit 8d97a9e

File tree

2 files changed

+49
-34
lines changed

2 files changed

+49
-34
lines changed
Lines changed: 33 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
1-
name: Hotpath Comment
1+
name: hotpath-comment
22

33
on:
44
workflow_run:
5-
workflows: ["Hotpath Profile"]
5+
workflows: ["hotpath-profile"]
66
types:
77
- completed
88

99
permissions:
10+
contents: read
1011
pull-requests: write
1112

1213
jobs:
@@ -15,35 +16,47 @@ jobs:
1516
if: ${{ github.event.workflow_run.conclusion == 'success' }}
1617

1718
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
1822
- name: Download profiling results
1923
uses: actions/download-artifact@v4
2024
with:
2125
name: hotpath-results
26+
path: /tmp/
2227
github-token: ${{ secrets.GITHUB_TOKEN }}
2328
run-id: ${{ github.event.workflow_run.id }}
2429

25-
- name: Read PR number
26-
id: pr
27-
run: echo "number=$(cat pr_number.txt)" >> $GITHUB_OUTPUT
28-
2930
- name: Setup Rust
3031
uses: actions-rust-lang/setup-rust-toolchain@v1
3132

3233
- name: Install hotpath CLI
3334
run: cargo install hotpath
3435

3536
- name: Post timing comparison comment
36-
run: |
37-
hotpath profile-pr \
38-
--head-metrics head-timing.json \
39-
--base-metrics base-timing.json \
40-
--github-token ${{ secrets.GITHUB_TOKEN }} \
41-
--pr-number ${{ steps.pr.outputs.number }}
42-
43-
- name: Post allocation comparison comment
44-
run: |
45-
hotpath profile-pr \
46-
--head-metrics head-alloc.json \
47-
--base-metrics base-alloc.json \
48-
--github-token ${{ secrets.GITHUB_TOKEN }} \
49-
--pr-number ${{ steps.pr.outputs.number }}
37+
env:
38+
GH_TOKEN: ${{ github.token }}
39+
run: |
40+
set -euo pipefail
41+
HEAD_METRICS=$(cat /tmp/head_timing.json)
42+
BASE_METRICS=$(cat /tmp/base_timing.json)
43+
PR_NUMBER=$(cat /tmp/pr_number.txt)
44+
hotpath profile-pr \
45+
--head-metrics "$HEAD_METRICS" \
46+
--base-metrics "$BASE_METRICS" \
47+
--github-token "$GH_TOKEN" \
48+
--pr-number "$PR_NUMBER"
49+
50+
- name: Post allocation comparison comment
51+
env:
52+
GH_TOKEN: ${{ github.token }}
53+
run: |
54+
set -euo pipefail
55+
HEAD_METRICS=$(cat /tmp/head_alloc.json)
56+
BASE_METRICS=$(cat /tmp/base_alloc.json)
57+
PR_NUMBER=$(cat /tmp/pr_number.txt)
58+
hotpath profile-pr \
59+
--head-metrics "$HEAD_METRICS" \
60+
--base-metrics "$BASE_METRICS" \
61+
--github-token "$GH_TOKEN" \
62+
--pr-number "$PR_NUMBER"
Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Hotpath Profile
1+
name: hotpath-profile
22

33
on:
44
pull_request:
@@ -14,6 +14,8 @@ jobs:
1414
steps:
1515
- name: Checkout PR HEAD
1616
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
1719

1820
- name: Setup Rust
1921
uses: actions-rust-lang/setup-rust-toolchain@v1
@@ -22,42 +24,42 @@ jobs:
2224
env:
2325
HOTPATH_JSON: "true"
2426
run: |
25-
cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > head-timing.json
27+
cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/head_timing.json
2628
2729
- name: Run allocation profiling on HEAD
2830
env:
2931
HOTPATH_JSON: "true"
3032
run: |
31-
cargo run --features='hotpath,hotpath-alloc-count-total' 2>&1 | grep '^{"hotpath_profiling_mode"' > head-alloc.json
33+
cargo run --features='hotpath,hotpath-alloc' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/head_alloc.json
3234
3335
- name: Checkout base branch
34-
uses: actions/checkout@v4
35-
with:
36-
ref: ${{ github.event.pull_request.base.sha }}
36+
run: |
37+
git checkout ${{ github.event.pull_request.base.sha }}
3738
3839
- name: Run timing profiling on base
3940
env:
4041
HOTPATH_JSON: "true"
4142
run: |
42-
cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > base-timing.json
43+
cargo run --features='hotpath' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/base_timing.json || echo '{}' > /tmp/base_timing.json
4344
4445
- name: Run allocation profiling on base
4546
env:
4647
HOTPATH_JSON: "true"
4748
run: |
48-
cargo run --features='hotpath,hotpath-alloc-count-total' 2>&1 | grep '^{"hotpath_profiling_mode"' > base-alloc.json
49+
cargo run --features='hotpath,hotpath-alloc' 2>&1 | grep '^{"hotpath_profiling_mode"' > /tmp/base_alloc.json || echo '{}' > /tmp/base_alloc.json
4950
5051
- name: Save PR number
51-
run: echo "${{ github.event.number }}" > pr_number.txt
52+
run: |
53+
echo '${{ github.event.pull_request.number }}' > /tmp/pr_number.txt
5254
5355
- name: Upload profiling results
5456
uses: actions/upload-artifact@v4
5557
with:
5658
name: hotpath-results
5759
path: |
58-
head-timing.json
59-
head-alloc.json
60-
base-timing.json
61-
base-alloc.json
62-
pr_number.txt
60+
/tmp/head_timing.json
61+
/tmp/head_alloc.json
62+
/tmp/base_timing.json
63+
/tmp/base_alloc.json
64+
/tmp/pr_number.txt
6365
retention-days: 1

0 commit comments

Comments
 (0)