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

Run profiler only on release and on demand #1392

Merged
merged 2 commits into from
Nov 16, 2024
Merged
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
20 changes: 10 additions & 10 deletions .github/workflows/profile.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# Copied from Flavio W. Brasil's work on Kyo: https://github.com/fwbrasil/kyo
name: profile
on:
push:
branches:
- main
pull_request:
types: [ opened, reopened, synchronize ]

# Prevent multiple builds at the same time from the same branch (except for 'master').
concurrency:
group: ${{ github.workflow }}-${{ github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && github.run_id || github.ref }}
cancel-in-progress: true
release:
types: [ created ]
workflow_dispatch:
inputs:
ref:
description: 'The branch, tag or commit SHA to checkout for profiling. Leave empty for the default branch'
required: true
type: string
default: ''

permissions:
contents: write
Expand All @@ -24,6 +23,7 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it supply the right value for ref when running a release?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ref parameter has default value "" which means take the default branch. This is what we had before as well.

When this action is run from a release the ref input it not set. So I am actually not sure it this will work (does this evaluate to empty string when the ref is not set?). Perhaps we should give the input parameter an explicit default value of "".

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added an explicit default value. So now it should be fine.

fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v4
Expand Down
Loading