Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test regression check issue #53

Closed
wants to merge 4 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions .github/workflows/create-issue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,51 @@ on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches: [main]
merge_group:

name: Create an issue on merge_group
name: Create an issue

jobs:
open-issue:
if: github.event_name != 'pull_request' || github.event.action == 'enqueued'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check for perf regression
id: regression-check
run: |
REGRESSIONS="1.00 1.00"

echo $REGRESSIONS

if [ ! -z "${{ env.LURK_BENCH_NOISE_THRESHOLD}}" ]; then
REGRESSION_FACTOR=$(echo "${{ env.LURK_BENCH_NOISE_THRESHOLD }}+1" | bc)
else
REGRESSION_FACTOR=1.1
fi
echo "NOISE_THRESHOLD=$(echo "($REGRESSION_FACTOR-1)*100" | bc)" | tee -a $GITHUB_ENV

for r in $REGRESSIONS
do
if (( $(echo "$r >= $REGRESSION_FACTOR" | bc -l) ))
then
echo "regression=true" | tee -a $GITHUB_OUTPUT
fi
done
# Not possible to use ${{ github.event.number }} with the `merge_group` trigger
- name: Get PR number from merge branch
if: steps.regression-check.outputs.regression == 'true'
run: |
echo "PR_NUMBER=$(echo ${{ github.event.merge_group.head_ref }} | sed -e 's/.*pr-\(.*\)-.*/\1/')" | tee -a $GITHUB_ENV
- uses: JasonEtco/create-an-issue@v2
if: steps.regression-check.outputs.regression == 'true'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR_NUMBER: ${{ env.PR_NUMBER }}
GIT_SHA: ${{ github.sha }}
WORKFLOW_URL: "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
with:
filename: .github/ISSUE_TEMPLATE.md
- name: Commit bench result to `gh-pages` branch if no regression
if: steps.regression-check.outputs.regression != 'true'
run: |
echo "No regression, committed bench result"