Repository navigation
CI: Extract dependency handling to a custom action - #9212
Conversation
|
I'm not exactly sure why, but with this change, and if there's a cache hit on contrib, the Windows build takes 23 minutes. |
📝 WalkthroughWalkthroughAdds a new composite GitHub Action to centralize OS-specific dependency installation and cmake prefix emission; refactors the CI workflow to use this action, remove the standalone Windows contrib job, and update repository paths and artifact steps to a top-level layout. Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow as "GitHub Workflow"
participant Action as "deps Composite Action"
participant Runner as "Runner (Windows/Linux/macOS)"
participant Contrib as "contrib submodule / cache"
participant Conda as "Conda/Miniconda + mamba"
participant Scripts as "tools/ci/* scripts"
Workflow->>Action: call `./.github/actions/dependencies` (inputs: os, compiler, compiler_ver)
Action->>Runner: execute OS-specific steps
alt Windows
Runner->>Contrib: compute contrib revision & try restore cache
Contrib-->>Runner: cache hit or miss
Runner->>Contrib: configure/build contrib if cache miss
Runner->>Conda: install Miniconda, mamba, Qt, extra conda pkgs
Conda-->>Runner: provide `Library` path (cmake_prefix fragment)
Runner->>Action: emit windows cmake_prefix fragment
else Linux
Runner->>Scripts: run `tools/ci/deps-ubuntu.sh`
Scripts-->>Runner: deps installed (install libomp if clang)
Runner->>Action: emit linux cmake_prefix fragment (if any)
else macOS
Runner->>Scripts: run `tools/ci/deps-macos.sh`, install `ccache`
Scripts-->>Runner: provide Homebrew prefix fragments
Runner->>Action: emit macOS cmake_prefix fragment
end
Action->>Workflow: output combined semicolon-separated `cmake_prefix`
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🧹 Nitpick comments (1)
.github/actions/dependencies/action.yml (1)
35-35: Include compiler/toolset dimensions in the contrib cache key.Line 35 can restore a
contrib/buildproduced with a different MSVC/toolset ifcompiler_verchanges but the submodule revision does not. Please include the compiler, compiler version, and architecture in the key to avoid stale ABI/toolchain caches.♻️ Proposed cache-key tightening
- key: ${{ inputs.os }}-${{ steps.contrib-rev.outputs.rev }} + key: ${{ inputs.os }}-${{ runner.arch }}-${{ inputs.compiler }}-${{ inputs.compiler_ver }}-${{ steps.contrib-rev.outputs.rev }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/dependencies/action.yml at line 35, The cache key for contrib in .github/actions/dependencies/action.yml currently uses only inputs.os and steps.contrib-rev.outputs.rev which can restore a build produced with a different toolset; update the key field to include the compiler dimensions by appending inputs.compiler, inputs.compiler_ver and inputs.arch (e.g. include ${{ inputs.compiler }}-${{ inputs.compiler_ver }}-${{ inputs.arch }}) alongside ${{ inputs.os }} and ${{ steps.contrib-rev.outputs.rev }} so ABI/toolchain-variant builds cannot collide.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/openms_ci_matrix_full.yml:
- Around line 252-253: The loop currently converts POSIX paths to Windows form
unconditionally by using echo ${thirdpartytool//\//\\} >> $GITHUB_PATH; change
it to be OS-aware: detect RUNNER_OS (or the matrix OS) and only perform the
slash-to-backslash replacement when on Windows, otherwise append the original
POSIX path unchanged (echo "$thirdpartytool" >> $GITHUB_PATH). Also add an
existence check inside the loop (e.g., test -e or test -d on thirdpartytool) and
if a required thirdparty entry is missing, print a clear error and exit non-zero
so the workflow fails early rather than adding unusable PATH entries.
- Around line 997-999: The handleGitTag calls are passing bare repo names which
the handleGitTag function expects in owner/repo format for constructing GitHub
API paths; update the three invocations that call handleGitTag (currently
passing "contrib", "THIRDPARTY", and "de.openms.knime") to use their
owner-qualified repository names (e.g., "openms/contrib" or the correct owner
prefix for THIRDPARTY and de.openms.knime) while keeping the same SHA variables
($CONTRIB_SHA, $THIRDPARTY_SHA, $DEOPENMS_SHA) so the function builds valid
/repos/${REPO}/git/refs/... paths and avoids 404s.
---
Nitpick comments:
In @.github/actions/dependencies/action.yml:
- Line 35: The cache key for contrib in .github/actions/dependencies/action.yml
currently uses only inputs.os and steps.contrib-rev.outputs.rev which can
restore a build produced with a different toolset; update the key field to
include the compiler dimensions by appending inputs.compiler,
inputs.compiler_ver and inputs.arch (e.g. include ${{ inputs.compiler }}-${{
inputs.compiler_ver }}-${{ inputs.arch }}) alongside ${{ inputs.os }} and ${{
steps.contrib-rev.outputs.rev }} so ABI/toolchain-variant builds cannot collide.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 6ce03935-918f-4627-954f-78a59ae36e93
📒 Files selected for processing (2)
.github/actions/dependencies/action.yml.github/workflows/openms_ci_matrix_full.yml
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/actions/dependencies/action.yml:
- Around line 21-35: The contrib cache key extraction is fragile because the
contrib-rev step parses `git submodule status --cached` with sed which fails for
other status prefixes; update the contrib-rev step to obtain the gitlink SHA
directly from the tree (e.g., replace the current `git submodule ... | sed ...`
pipeline with a `git ls-tree` invocation that reads the tree entry for the
contrib path and outputs the blob/commit SHA) so the `rev` variable used by the
cache-contrib step is always the exact submodule gitlink SHA independent of
submodule status; keep the step id contrib-rev and the output name rev so
cache-contrib's key ${{ steps.contrib-rev.outputs.rev }} continues to work.
In @.github/workflows/openms_ci_matrix_full.yml:
- Around line 481-488: The tar invocation that builds OpenMS-${{
steps.create_changelog.outputs.version_number }}.tar.gz from ${{
github.workspace }} can include CI-generated directories like _thirdparty/ and
.ccache/ which should be excluded; update the tar --exclude list in the tar
command (the line starting with tar --exclude=... -czf OpenMS-${{
steps.create_changelog.outputs.version_number }}.tar.gz -C ${{ github.workspace
}} .) to add exclusions for at least '_thirdparty/**' and '.ccache/**' (and any
other root-level CI artifact dirs) so the created source archive does not
contain CI artifacts.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: d4ce5adb-1d71-436c-bef8-5f36c0869a16
📒 Files selected for processing (2)
.github/actions/dependencies/action.yml.github/workflows/openms_ci_matrix_full.yml
|
probably fine :) some issue with thirdparty... |
- All dependencies (including contrib) are dealt with in a separate action, perfect for the upcoming GSoC project - Remove redundant installation of cURL on Windows (already in contrib) - Remove redundant installation of Eigen on Windows (already in contrib) - Removed weird cloning of the OpenMS repo into a sub-directory in the workspace that required each step to move into the correct directory - Updated action versions to avoid pending nodejs issues on the GitHub runners
Yep. I moved some code without running the CI workflow again :( Should be fixed now. We'll see in a bit. |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
.github/workflows/openms_ci_matrix_full.yml (2)
313-315: Dead reference to a removed step id in the commented-out line.
Eigen3_DIR: "${{ steps.tools-prefix.outputs.eigen_choco }}"still referencessteps.tools-prefix, which no longer exists in this workflow now that Eigen is provided via contrib on Windows (per the PR description). Since the step is removed and the line is already commented out, consider deleting the line outright rather than leaving a stale reference that will produce an empty string if ever re-enabled.Cleanup diff
WITH_THERMORAWFILEPARSER_TEST: "OFF" - `#Eigen3_DIR`: "${{ steps.tools-prefix.outputs.eigen_choco }}" # Eigen is installed on windows using choco USE_EXTERNAL_JSON: ${{ (startsWith(matrix.os, 'macos') || startsWith(matrix.os, 'windows')) && 'OFF' || 'ON' }}🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/openms_ci_matrix_full.yml around lines 313 - 315, Remove the stale commented reference to steps.tools-prefix by deleting the commented line containing Eigen3_DIR: "${{ steps.tools-prefix.outputs.eigen_choco }}"; specifically remove the commented Eigen3_DIR line so there is no dead reference to steps.tools-prefix in the workflow, leaving the USE_EXTERNAL_JSON and WITH_THERMORAWFILEPARSER_TEST lines intact.
258-260: Minor: prefermkdir -p bldand consider explicitcd bld.
mkdir bldwill fail ifbldalready exists (e.g., if someone later adds a step that prepares it, or if a restored cache places something there). Usingmkdir -p bldis safer and is what the rest of the workflow already does for.ccacheat Line 251. Not a blocker.Nit diff
- mkdir bld + mkdir -p bld bash tools/ci/capture-env.sh -v $GITHUB_WORKSPACE/bld/CMakeCache.txt🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/workflows/openms_ci_matrix_full.yml around lines 258 - 260, Replace the brittle "mkdir bld" invocation in the CI step with a safe "mkdir -p bld" and (optionally) add an explicit "cd bld" before running bash tools/ci/capture-env.sh and the ctest command to ensure subsequent commands run in the intended build directory; update the block that currently contains "mkdir bld", "bash tools/ci/capture-env.sh -v $GITHUB_WORKSPACE/bld/CMakeCache.txt", and "$GITHUB_WORKSPACE... ctest ..." to use "mkdir -p bld" and change working directory to "bld" (or adjust paths accordingly)..github/actions/dependencies/action.yml (2)
55-83: Fail fast if the architecture-specific THIRDPARTY directory is missing.The
cp -R "THIRDPARTY/$tp_folder/$(uname -m)"/*line (Line 71) will emit an error to stderr and set a non-zero exit ofcp, but because no architecture-specific pre-check is done, a typo in$tp_foldermapping or a missingaarch64/arm64subfolder will fail in a confusing way (cp: cannot stat ...) rather than with a clear diagnostic. Given that architecture-specific THIRDPARTY tools are required dependencies, consider validating up front and exiting with a clear message so CI fails fast and obviously when a new runner arch is added without a matching THIRDPARTY folder.🛡️ Suggested pre-check
tp_folder=${{ runner.os }} if [ "$tp_folder" = "macOS" ]; then tp_folder=MacOS fi + arch_dir="THIRDPARTY/$tp_folder/$(uname -m)" + if [ ! -d "$arch_dir" ]; then + echo "::error::Missing THIRDPARTY tools for $tp_folder/$(uname -m) (expected $arch_dir)" + exit 1 + fi + # Copy the correct architecture - cp -R "THIRDPARTY/$tp_folder/$(uname -m)"/* _thirdparty/ + cp -R "$arch_dir"/* _thirdparty/Based on learnings, architecture-specific THIRDPARTY tools in the OpenMS CI workflows are required dependencies and the workflow should fail immediately if these tools are not found, rather than continuing with warnings or graceful degradation.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/dependencies/action.yml around lines 55 - 83, Add an explicit existence check for the architecture-specific THIRDPARTY directory before running cp: after computing tp_folder (and mapping macOS→MacOS) verify that the path "THIRDPARTY/$tp_folder/$(uname -m)" exists and is a directory, and if not echo a clear diagnostic including the resolved tp_folder and output of uname -m then exit 1 so the job fails fast; refer to the tp_folder variable and the cp invocation ("THIRDPARTY/$tp_folder/$(uname -m)"/*) in the action.yml snippet to locate where to insert this guard.
29-35: Consider including the MSVC toolset/runner image in the contrib cache key.The cache key is
${{ inputs.os }}-${{ steps.contrib-rev.outputs.rev }}. Because the cachedcontrib/buildcontains MSVC-compiled binaries, a future bump of the Windows runner image (e.g.,windows-2025→windows-2026) or of thecl.exe/ Visual Studio generator version in the matrix can result in restoring artifacts built against a different toolchain, while the key still matches (since the submodule SHA is unchanged). Consider extending the key withmatrix.compiler_ver(passed through as an input) and/or the runner image label so the cache is invalidated when the build environment changes meaningfully.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In @.github/actions/dependencies/action.yml around lines 29 - 35, The contrib cache key for the cache step with id cache-contrib currently only uses ${{ inputs.os }} and ${{ steps.contrib-rev.outputs.rev }}, which allows restoring MSVC-built artifacts across different Windows runner/toolset versions; update the key expression used by the actions/cache@v5 step so it also includes the Windows runner image and/or the compiler/toolset version passed into the action (e.g., inputs.compiler_ver and a runner image input like inputs.runner_image or inputs.os_image) so the key becomes sensitive to changes in the build environment that affect MSVC binaries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/actions/dependencies/action.yml:
- Around line 149-153: The NSIS download step currently fetches NSIS.tar.gz and
extracts it without validation; change the sequence around the curl/7z lines
(the NSIS.tar.gz download, 7z extraction, and echo to $GITHUB_PATH) to instead
pin the download URL to a specific OpenMS/NSIS commit or tag, also download a
corresponding checksum (or embed a known SHA-256 for the pinned artifact) and
verify the tarball integrity using a sha256 check before extracting to
"C:/Program Files (x86)/NSIS/"; only proceed to extract and append to
$GITHUB_PATH if the checksum verification of NSIS.tar.gz succeeds.
---
Nitpick comments:
In @.github/actions/dependencies/action.yml:
- Around line 55-83: Add an explicit existence check for the
architecture-specific THIRDPARTY directory before running cp: after computing
tp_folder (and mapping macOS→MacOS) verify that the path
"THIRDPARTY/$tp_folder/$(uname -m)" exists and is a directory, and if not echo a
clear diagnostic including the resolved tp_folder and output of uname -m then
exit 1 so the job fails fast; refer to the tp_folder variable and the cp
invocation ("THIRDPARTY/$tp_folder/$(uname -m)"/*) in the action.yml snippet to
locate where to insert this guard.
- Around line 29-35: The contrib cache key for the cache step with id
cache-contrib currently only uses ${{ inputs.os }} and ${{
steps.contrib-rev.outputs.rev }}, which allows restoring MSVC-built artifacts
across different Windows runner/toolset versions; update the key expression used
by the actions/cache@v5 step so it also includes the Windows runner image and/or
the compiler/toolset version passed into the action (e.g., inputs.compiler_ver
and a runner image input like inputs.runner_image or inputs.os_image) so the key
becomes sensitive to changes in the build environment that affect MSVC binaries.
In @.github/workflows/openms_ci_matrix_full.yml:
- Around line 313-315: Remove the stale commented reference to
steps.tools-prefix by deleting the commented line containing Eigen3_DIR: "${{
steps.tools-prefix.outputs.eigen_choco }}"; specifically remove the commented
Eigen3_DIR line so there is no dead reference to steps.tools-prefix in the
workflow, leaving the USE_EXTERNAL_JSON and WITH_THERMORAWFILEPARSER_TEST lines
intact.
- Around line 258-260: Replace the brittle "mkdir bld" invocation in the CI step
with a safe "mkdir -p bld" and (optionally) add an explicit "cd bld" before
running bash tools/ci/capture-env.sh and the ctest command to ensure subsequent
commands run in the intended build directory; update the block that currently
contains "mkdir bld", "bash tools/ci/capture-env.sh -v
$GITHUB_WORKSPACE/bld/CMakeCache.txt", and "$GITHUB_WORKSPACE... ctest ..." to
use "mkdir -p bld" and change working directory to "bld" (or adjust paths
accordingly).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 15b41d32-8e9e-4b21-9af0-8ee002523739
📒 Files selected for processing (2)
.github/actions/dependencies/action.yml.github/workflows/openms_ci_matrix_full.yml
|
@jpfeuffer where to install arrow 23 from? brew is on 24 already |
timosachsenberg
left a comment
There was a problem hiding this comment.
thanks! arrow unrelated
|
Can't you pin arrow to 23 in brew? Or what do you mean? |
|
https://docs.brew.sh/Versions |
|
I fixed arrow by allowing >23. I think brew only contains the newest one. |
All dependencies (including contrib) are dealt with in a separate action, perfect for the upcoming GSoC project
Remove redundant installation of cURL on Windows (already in contrib)
Remove redundant installation of Eigen on Windows (already in contrib)
Removed weird cloning of the OpenMS repo into a sub-directory in the workspace that required each step to move into the correct directory
Updated action versions to avoid pending nodejs issues on the GitHub runners
Summary by CodeRabbit