Skip to content

Commit c61f6b6

Browse files
feat: split install and run into two different steps
This allows the path to be properly updated when installing on a minimal system From the generated installer by cargo-dist ``` add_install_dir_to_ci_path() { # Attempt to do CI-specific rituals to get the install-dir on PATH faster local _install_dir="$1" # If GITHUB_PATH is present, then write install_dir to the file it refs. # After each GitHub Action, the contents will be added to PATH. # So if you put a curl | sh for this script in its own "run" step, # the next step will have this dir on PATH. # # Note that GITHUB_PATH will not resolve any variables, so we in fact # want to write install_dir and not install_dir_expr if [ -n "${GITHUB_PATH:-}" ]; then ensure echo "$_install_dir" >> "$GITHUB_PATH" fi } ```
1 parent f748d0c commit c61f6b6

1 file changed

Lines changed: 18 additions & 16 deletions

File tree

action.yml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -143,26 +143,13 @@ runs:
143143
const version = process.env.RUNNER_VERSION
144144
core.setOutput('hash', hashes[version] || '')
145145
146-
- shell: bash
147-
env:
148-
GH_MATRIX: "${{ toJson(matrix) }}"
149-
GH_STRATEGY: "${{ toJson(strategy) }}"
150-
# This is needed to properly handle quotes and multiline commands in the 'run' input properly, rather than doing `RUN_INPUT_RUN=${{ inputs.run }}` in the script
151-
CODSPEED_INPUT_RUN: ${{ inputs.run }}
146+
- name: Install CodSpeed runner
147+
shell: bash
152148
run: |
153-
# Validate required inputs
154-
# (custom message for smoother v4 migration)
155-
if [ -z "${{ inputs.mode }}" ]; then
156-
echo "::error title=Missing required input 'mode'::The 'mode' input is required as of CodSpeed Action v4. Please explicitly set 'mode' to 'simulation' or 'walltime'. Before, this variable was automatically set to instrumentation on every runner except for CodSpeed macro runners where it was set to walltime by default. See https://codspeed.io/docs/instruments for details."
157-
exit 1
158-
fi
159-
160-
# Configure and run codspeed-runner
161149
RUNNER_VERSION="${{ steps.versions.outputs.runner-version }}"
162150
VERSION_TYPE="${{ steps.versions.outputs.version-type }}"
163151
164-
# Install the runner
165-
SKIP_HASH_CHECK_WARNING_WARNING="${{ inputs.skip-hash-check-warning }}"
152+
SKIP_HASH_CHECK_WARNING="${{ inputs.skip-hash-check-warning }}"
166153
167154
if [ "$VERSION_TYPE" = "latest" ]; then
168155
if [ "$SKIP_HASH_CHECK_WARNING" != "true" ]; then
@@ -216,6 +203,21 @@ runs:
216203
bash "$INSTALLER_TMP" --quiet
217204
fi
218205
206+
- name: Run the benchmarks
207+
shell: bash
208+
env:
209+
GH_MATRIX: "${{ toJson(matrix) }}"
210+
GH_STRATEGY: "${{ toJson(strategy) }}"
211+
# This is needed to properly handle quotes and multiline commands in the 'run' input properly, rather than doing `RUN_INPUT_RUN=${{ inputs.run }}` in the script
212+
CODSPEED_INPUT_RUN: ${{ inputs.run }}
213+
run: |
214+
# Validate required inputs
215+
# (custom message for smoother v4 migration)
216+
if [ -z "${{ inputs.mode }}" ]; then
217+
echo "::error title=Missing required input 'mode'::The 'mode' input is required as of CodSpeed Action v4. Please explicitly set 'mode' to 'simulation' or 'walltime'. Before, this variable was automatically set to instrumentation on every runner except for CodSpeed macro runners where it was set to walltime by default. See https://codspeed.io/docs/instruments for details."
218+
exit 1
219+
fi
220+
219221
# Build the runner arguments array
220222
RUNNER_ARGS=()
221223
if [ -n "${{ inputs.token }}" ]; then

0 commit comments

Comments
 (0)