Skip to content

Commit 2555020

Browse files
authored
Merge pull request #2 from JacobLinCool/ci-pr-compare
ci: benchmark pr
2 parents 741d8cf + dd0a70d commit 2555020

File tree

3 files changed

+41
-1
lines changed

3 files changed

+41
-1
lines changed

.github/workflows/CI.yml

+14
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,20 @@ jobs:
171171
with:
172172
command: upload
173173
args: --non-interactive --skip-existing wheels-*/*
174+
175+
release-crate:
176+
name: Release Crate
177+
runs-on: ubuntu-latest
178+
if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }}
179+
permissions:
180+
# Use to sign the release artifacts
181+
id-token: write
182+
steps:
183+
- uses: actions/checkout@v4
184+
- name: Install Rust
185+
uses: actions-rs/toolchain@v1
186+
with:
187+
toolchain: stable
174188
- name: Publish to crates.io
175189
if: startsWith(github.ref, 'refs/tags/')
176190
run: cargo publish --token ${{ secrets.CARGO_TOKEN }}

.github/workflows/pr.yml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: benchmark pull requests
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
runBenchmark:
8+
name: run benchmark
9+
runs-on: macos-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: Install Rust
13+
uses: actions-rs/toolchain@v1
14+
with:
15+
toolchain: stable
16+
- uses: boa-dev/criterion-compare-action@v3
17+
with:
18+
# The name of the branch to compare with. This default uses the branch which is being pulled against
19+
branchName: ${{ github.base_ref }}
20+
token: ${{ secrets.GITHUB_TOKEN }}

Cargo.toml

+7-1
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,17 @@ repository = "https://github.com/JacobLinCool/tja-rs"
1111
[[bin]]
1212
name = "tja"
1313
path = "src/bin/tja.rs"
14-
required-features = [] # Binary works without any features
14+
bench = false
15+
16+
[[bin]]
17+
name = "profile"
18+
path = "src/bin/profile.rs"
19+
bench = false
1520

1621
[lib]
1722
name = "tja"
1823
crate-type = ["cdylib", "rlib"]
24+
bench = false
1925

2026
[features]
2127
default = []

0 commit comments

Comments
 (0)