-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
isolate performance_test github action (#29)
make sure the performance_test and comment only happen on pull requests.
- Loading branch information
1 parent
639cad9
commit 79dde51
Showing
2 changed files
with
53 additions
and
46 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
pull_request: | ||
branches: [ main ] | ||
|
||
env: | ||
BUILD_TYPE: Debug | ||
|
||
jobs: | ||
performance_test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: install compiler | ||
run: sudo apt update && sudo apt-get install -y clang-12 | ||
|
||
- name: Configure CMake | ||
env: | ||
CC: clang-12 | ||
CXX: clang++-12 | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
|
||
- name: Build | ||
id: build_step | ||
run: | | ||
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -t compilation_benchmark |& tee ${{github.workspace}}/build/compilation_output.log | ||
echo "::set-output name=compile_benchmark_time::"`grep "Clang front-end timer" ${{github.workspace}}/build/compilation_output.log | grep -o "^\s\+\S\+\s" | grep -o "\S\+"` | ||
- name: Post compilation performance to pull rquest | ||
uses: actions/github-script@v5 | ||
with: | ||
github-token: ${{secrets.GITHUB_TOKEN}} | ||
script: | | ||
github.rest.issues.createComment({ | ||
issue_number: context.issue.number, | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
body: '### ⏱ 🏁 big_nexus.cpp compilation benchmark took **${{ steps.build_step.outputs.compile_benchmark_time }}** seconds' | ||
}) | ||
- name: 'Upload Compilation Trace' | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: compilation_trace.json | ||
path: ${{github.workspace}}/build/benchmark/CMakeFiles/compilation_benchmark.dir/big_nexus.cpp.json | ||
|
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