Skip to content

Commit

Permalink
Add the possibility to add feature flags for a benchmark (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
1c3t3a authored Feb 6, 2022
1 parent 0c200a7 commit 4a46bfa
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ jobs:
cwd: "subDirectory (optional)"
# Optional. Compare only this benchmark target
benchName: "example-bench-target"
# Optional. Features activated in the benchmark
features: "async,tokio-support"
# Needed. The name of the branch to compare with. This default uses the branch which is being pulled against
branchName: ${{ github.base_ref }}
token: ${{ secrets.GITHUB_TOKEN }}
Expand Down
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ inputs:
description: "Compare only this benchmark"
required: false
default: ""
features:
description: "A list of comma seperated features that are activated for this benchmark"
required: false
default: ""
runs:
using: "node16"
main: "dist/index.js"
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ async function main() {
branchName: core.getInput("branchName", { required: true }),
cwd: core.getInput("cwd"),
benchName: core.getInput("benchName"),
features: core.getInput("features"),
};
core.debug(`Inputs: ${inspect(inputs)}`);

Expand All @@ -26,6 +27,10 @@ async function main() {
benchCmd = benchCmd.concat(["--bench", inputs.benchName]);
}

if (inputs.features) {
benchCmd = benchCmd.concat(["--features", inputs.features]);
}

core.debug("### Install Critcmp ###");
await exec.exec("cargo", ["install", "critcmp"]);

Expand Down

0 comments on commit 4a46bfa

Please sign in to comment.