-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
292 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: lit Example | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
permissions: | ||
contents: write | ||
deployments: write | ||
|
||
jobs: | ||
benchmark: | ||
name: Run lit benchmark example | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.13' | ||
- run: pip install lit | ||
- name: Run benchmark | ||
run: lit examples/lit --resultdb-output examples/lit/output.json | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: lit benchmark result | ||
tool: 'lit' | ||
output-file-path: examples/lit/output.json | ||
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t/github-action-not-triggering-gh-pages-upon-push/16096 | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
auto-push: true | ||
# Show alert with commit comment on detecting possible performance regression | ||
alert-threshold: '200%' | ||
comment-on-alert: true | ||
fail-on-alert: true | ||
alert-comment-cc-users: '@tgymnich' | ||
|
||
- name: Store benchmark result - separate results repo | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
name: lit benchmark result | ||
tool: 'lit' | ||
output-file-path: examples/lit/output.json | ||
# Use personal access token instead of GITHUB_TOKEN due to https://github.community/t/github-action-not-triggering-gh-pages-upon-push/16096 | ||
github-token: ${{ secrets.BENCHMARK_ACTION_BOT_TOKEN }} | ||
auto-push: true | ||
# Show alert with commit comment on detecting possible performance regression | ||
alert-threshold: '200%' | ||
comment-on-alert: true | ||
fail-on-alert: true | ||
alert-comment-cc-users: '@tgymnich' | ||
gh-repository: 'github.com/benchmark-action/github-action-benchmark-results' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# lit - LLVM Integrated Tester Example | ||
|
||
- [lit docs](https://llvm.org/docs/CommandGuide/lit.html) | ||
- [Workflow for this example](../../.github/workflows/lit.yml) | ||
|
||
This directory shows how to use [`github-action-benchmark`](https://github.com/benchmark-action/github-action-benchmark) | ||
with [lit](https://llvm.org/docs/CommandGuide/lit.html). | ||
|
||
## Run benchmarks | ||
|
||
Install dependencies with `venv` package using Python3. | ||
|
||
```sh | ||
$ python -m venv venv | ||
$ source venv/bin/activate | ||
$ pip install lit | ||
``` | ||
|
||
Setup your test suite. In this example it consists of a configuration file for lit `lit.cfg` and two tests `a.txt` and `b.txt` containing one RUN line each. | ||
|
||
e.g | ||
|
||
```python | ||
import lit.formats | ||
|
||
config.name = "time-tests" | ||
config.suffixes = [".txt"] | ||
config.test_format = lit.formats.ShTest() | ||
config.test_source_root = None | ||
config.test_exec_root = None | ||
``` | ||
|
||
``` | ||
# RUN: true | ||
``` | ||
|
||
``` | ||
# RUN: sleep 1 | ||
``` | ||
|
||
And run the test suite with `--resultdb-output` in workflow. The JSON file will be an input to github-action-benchmark. | ||
|
||
e.g. | ||
|
||
```yaml | ||
- name: Run benchmark | ||
run: lit examples/lit --resultdb-output output.json | ||
``` | ||
## Process benchmark results | ||
Store the benchmark results with step using the action. Please set `tool` to `lit` input and pass the path to the output file. | ||
|
||
```yaml | ||
- name: Store benchmark result | ||
uses: benchmark-action/github-action-benchmark@v1 | ||
with: | ||
tool: 'lit' | ||
output-file-path: output.json | ||
``` | ||
|
||
Please read ['How to use' section](https://github.com/benchmark-action/github-action-benchmark#how-to-use) for common usage. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# RUN: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# RUN: sleep 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# -*- Python -*- | ||
|
||
import lit.formats | ||
|
||
config.name = "time-tests" | ||
config.suffixes = [".txt"] | ||
config.test_format = lit.formats.ShTest() | ||
config.test_source_root = None | ||
config.test_exec_root = None |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
{ | ||
"__version__": [ | ||
18, | ||
1, | ||
8 | ||
], | ||
"elapsed": 1.0956830978393555, | ||
"tests": [ | ||
{ | ||
"artifacts": { | ||
"artifact-content-in-request": { | ||
"contents": "RXhpdCBDb2RlOiAwCgpDb21tYW5kIE91dHB1dCAoc3Rkb3V0KToKLS0KIyBSVU46IGF0IGxpbmUgMQpzbGVlcCAxCiMgZXhlY3V0ZWQgY29tbWFuZDogc2xlZXAgMQoKLS0K" | ||
} | ||
}, | ||
"duration": "1.009553909s", | ||
"expected": true, | ||
"start_time": "2025-01-19T20:13:43.882058Z", | ||
"status": "PASS", | ||
"summary_html": "<p><text-artifact artifact-id=\"artifact-content-in-request\"></p>", | ||
"testId": "time-tests :: b.txt" | ||
}, | ||
{ | ||
"artifacts": { | ||
"artifact-content-in-request": { | ||
"contents": "RXhpdCBDb2RlOiAwCgpDb21tYW5kIE91dHB1dCAoc3Rkb3V0KToKLS0KIyBSVU46IGF0IGxpbmUgMQp0cnVlCiMgZXhlY3V0ZWQgY29tbWFuZDogdHJ1ZQoKLS0K" | ||
} | ||
}, | ||
"duration": "0.003667116s", | ||
"expected": true, | ||
"start_time": "2025-01-19T20:13:43.882072Z", | ||
"status": "PASS", | ||
"summary_html": "<p><text-artifact artifact-id=\"artifact-content-in-request\"></p>", | ||
"testId": "time-tests :: a.txt" | ||
} | ||
] | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters