Skip to content

Commit 858b248

Browse files
authored
Merge pull request #25 from NotAShelf/notashelf/push-orrzkvopklqm
treewide: bump deps and update docs
2 parents 5480d2d + fa8b6b9 commit 858b248

File tree

10 files changed

+224
-63
lines changed

10 files changed

+224
-63
lines changed

.github/dependabot.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
version: 2
2+
updates:
3+
# Update Cargo deps
4+
- package-ecosystem: cargo
5+
directory: "/"
6+
schedule:
7+
interval: "weekly"
8+
9+
# Update used workflows
10+
- package-ecosystem: github-actions
11+
directory: "/"
12+
schedule:
13+
interval: daily
14+
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

.github/workflows/rust.yml

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,45 @@ env:
1010
CARGO_TERM_COLOR: always
1111

1212
jobs:
13-
build:
14-
15-
runs-on: ubuntu-latest
13+
test:
14+
name: Test on ${{ matrix.target }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
include:
20+
- os: ubuntu-latest
21+
target: x86_64-unknown-linux-gnu
22+
- os: ubuntu-latest
23+
target: aarch64-unknown-linux-gnu
1624

1725
steps:
1826
- name: "Checkout"
1927
uses: actions/checkout@v4
20-
- name: "Build with Cargo"
21-
run: cargo build --verbose
28+
29+
- name: "Setup Rust toolchain"
30+
uses: actions-rust-lang/setup-rust-toolchain@v1
31+
with:
32+
target: ${{ matrix.target }}
33+
34+
- name: "Install cross-compilation tools"
35+
if: matrix.target == 'aarch64-unknown-linux-gnu'
36+
run: |
37+
sudo apt-get update
38+
sudo apt-get install -y gcc-aarch64-linux-gnu
39+
40+
- name: "Configure linker for aarch64"
41+
if: matrix.target == 'aarch64-unknown-linux-gnu'
42+
run: |
43+
mkdir -p .cargo
44+
cat >> .cargo/config.toml << EOF
45+
[target.aarch64-unknown-linux-gnu]
46+
linker = "aarch64-linux-gnu-gcc"
47+
EOF
48+
49+
- name: "Build"
50+
run: cargo build --verbose --target ${{ matrix.target }}
51+
52+
- name: "Run tests"
53+
if: matrix.target == 'x86_64-unknown-linux-gnu'
54+
run: cargo test --verbose --target ${{ matrix.target }}

0 commit comments

Comments
 (0)