Skip to content

Commit

Permalink
isolate performance_test github action (#29)
Browse files Browse the repository at this point in the history
make sure the performance_test and comment only happen on pull
requests.
  • Loading branch information
lukevalenty authored Apr 13, 2022
1 parent 639cad9 commit 79dde51
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 46 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/performance_test.yml
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

46 changes: 0 additions & 46 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -155,49 +155,3 @@ jobs:
with:
name: cib.hpp
path: ${{github.workspace}}/build/include/cib/cib.hpp



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

0 comments on commit 79dde51

Please sign in to comment.