Add install cmake action - #310
Conversation
c30f5aa to
062f1a7
Compare
... really? That's not even part of the license. |
062f1a7 to
c4e323a
Compare
|
Where do you see this going? I opened a PR a few months ago to add Cmake based workflows which we are using in the Swift Server world #229? Curious to hear your thoughts how this PR might relate to my PR. |
I see this allowing folks to install specific version(s) of CMake and then calling it. It's meant to compose with existing workflows by exposing the cmake binary as an output of the action. e.g.
The referenced PR only appears to work on apt-based Linux distros, rewrites the CMakeLists.txt, and then tries to run the build. To update that PR with this action in place, you could drop the - name: CMake build
run: |
which curl cmake ninja || apt -q update
which curl || apt -yq install curl
which cmake || apt -yq install cmake
which ninja || apt -yq install ninja-build
TARGET_DIRECTORY="${{ Then reference the output of the action with something like - name: Run CMake
shell: bash
env:
CMAKE: ${{ steps.install-cmake.outputs.ctest }}
run: |
"$CMAKE" -G Ninja -B build -S .
... |
c4e323a to
a3fc132
Compare
|
Please add a workflow to test this part of PR testing. |
Adding an action to install a specific version of CMake. The version is verified against a hash before being unpacked and installed.
a3fc132 to
0858150
Compare
Verify that we can download CMake and that we get the expected version.
0858150 to
3f2f66a
Compare
|
@shahmishal and I talked offline about also adding a default workflow that projects can use directly. I will put that up in a separate PR. I'd like to unblock Swift Format and Swift Foundation who are blocked after bumping Swift Syntax to requiring CMake 3.29. |
|
|
||
| # 3. Download | ||
| echo "==> Downloading ${ARCHIVE_URL}..." | ||
| curl -fsSL --retry 3 -o "${ARCHIVE_PATH}" "${ARCHIVE_URL}" |
There was a problem hiding this comment.
For the future and digging through the action marketplace, migrating this script to Javascript should let us drop all of the dependencies since nodejs is supposed to always be available.
Adding an action to install a specific version of CMake. The version is verified against a hash before being unpacked and installed.
I have verified this with several versions of CMake on Linux.
I haven't had a setup with macOS or Windows to test against yet, but the GitHub actions docs say that bash is available on all platforms (as is powershell, but I don't want to write powershell) with the note
The link format is consistent, with
cmake-<version>-<arch>.(tar.gz|.zip). There are OS-specific installer-based packages, but the tarballs and zips are easier to unpack and verify reliably.