Skip to content

Fix bugs

Fix bugs #17

Workflow file for this run

name: PR comment test
on:
issue_comment:
types: [created]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
test-secret:
name: Test access to secrets in a fork
runs-on: ubuntu-latest
if:
github.event.issue.pull_request
&& github.event.issue.state == 'open'
&& contains(github.event.comment.body, '!test')
&& (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
- uses: xt0rted/pull-request-comment-branch@v2
id: comment-branch
- uses: actions/checkout@v4
- name: Checkout PR branch
run: gh pr checkout ${{ github.event.issue_number }}
env:
GH_TOKEN: ${{ github.token }}
- name: Check private key exists
uses: actions/github-script@v6
with:
script: |
if ("${{ secrets.PRIVATE_KEY }}" == "") {
core.setFailed('Failed to access PRIVATE_KEY secret')
}
- name: Get PR number
- run: echo ${{ github.event.issue.number }}
- name: Get PR number take 2
- run: echo $(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH")
- name: Get PR number take 3
- run: echo $(echo $GITHUB_REF | awk 'BEGIN { FS = "/" } ; { print $3 }')
- name: Comment on successful run
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{ github.event.issue.number }}
body: |
`!test` action succeeded! :rocket:
https://github.com/lurk-lab/ci-lab/actions/runs/${{ github.run_id }}
test-bench:
name: Run benchmarks
runs-on: ubuntu-latest
if:
github.event.issue.pull_request
&& github.event.issue.state == 'open'
&& contains(github.event.comment.body, '!bench')
&& (github.event.comment.author_association == 'MEMBER' || github.event.comment.author_association == 'OWNER')
steps:
#- uses: xt0rted/pull-request-comment-branch@v2
# id: comment-branch
- uses: actions/checkout@v4
- run: echo ${{ github.ref_name }}
- name: Checkout PR branch
run: gh pr checkout ${{ github.event.issue_number }}
env:
GH_TOKEN: ${{ github.token }}
- uses: actions-rs/toolchain@v1
- uses: Swatinem/rust-cache@v2
- uses: boa-dev/criterion-compare-action@v3
with:
# Optional. Compare only this benchmark target
benchName: "fibonacci"
# Needed. The name of the branch to compare with
branchName: ${{ github.ref_name }}