diff --git a/template/.github/workflows/ci.yml b/template/.github/workflows/ci.yml index 839215c..735ccdf 100644 --- a/template/.github/workflows/ci.yml +++ b/template/.github/workflows/ci.yml @@ -13,7 +13,7 @@ jobs: env: CARGO_TERM_COLOR: always BUILD_PROFILE: debug - WHITAKER_INSTALLER_REV: f768c2e53c47df13658af1168a67851d388750bf + WHITAKER_INSTALLER_VERSION: '0.2.5' steps: - uses: actions/checkout@900f2210b1d28bbbd0bd22d17926b9e224e8f231 with: @@ -60,19 +60,18 @@ jobs: ~/.local/bin/whitaker ~/.dylint_drivers ~/.local/share/whitaker - key: whitaker-v2-${{ runner.os }}-${{ env.WHITAKER_INSTALLER_REV }} + key: whitaker-v3-${{ runner.os }}-${{ env.WHITAKER_INSTALLER_VERSION }} - name: Install Whitaker env: RUSTFLAGS: "" + WHITAKER_CACHE_HIT: ${{ steps.cache-whitaker.outputs.cache-hit }} run: | set -euo pipefail - echo "Whitaker cache hit: ${{ steps.cache-whitaker.outputs.cache-hit }}" - if [ "${{ steps.cache-whitaker.outputs.cache-hit }}" != "true" ]; then - echo "Installing Whitaker installer at ${WHITAKER_INSTALLER_REV}" - cargo install --locked \ - --git https://github.com/leynos/whitaker \ - --rev "${WHITAKER_INSTALLER_REV}" \ - whitaker-installer + echo "Whitaker cache hit: ${WHITAKER_CACHE_HIT}" + if [ "${WHITAKER_CACHE_HIT}" != "true" ]; then + echo "Installing whitaker-installer ${WHITAKER_INSTALLER_VERSION}" + cargo binstall --no-confirm --locked \ + whitaker-installer@"${WHITAKER_INSTALLER_VERSION}" fi whitaker-installer --cranelift echo "Whitaker binary: $(command -v whitaker || true)" diff --git a/tests/helpers/tooling_contracts/workflows.py b/tests/helpers/tooling_contracts/workflows.py index 30bacef..11ce099 100644 --- a/tests/helpers/tooling_contracts/workflows.py +++ b/tests/helpers/tooling_contracts/workflows.py @@ -187,7 +187,7 @@ def _assert_ci_workflow_contracts( assert "Whitaker cache hit:" in ci_workflow, ( "expected generated CI workflow to log Whitaker cache status" ) - assert "Installing Whitaker installer at" in ci_workflow, ( + assert "Installing whitaker-installer" in ci_workflow, ( "expected generated CI workflow to log Whitaker installation" ) assert "Whitaker binary:" in ci_workflow, ( diff --git a/tests/test_template/__snapshots__/test_snapshots.ambr b/tests/test_template/__snapshots__/test_snapshots.ambr index b33e517..6c18e97 100644 --- a/tests/test_template/__snapshots__/test_snapshots.ambr +++ b/tests/test_template/__snapshots__/test_snapshots.ambr @@ -72,7 +72,7 @@ 'env': dict({ 'BUILD_PROFILE': 'debug', 'CARGO_TERM_COLOR': 'always', - 'WHITAKER_INSTALLER_REV': 'f768c2e53c47df13658af1168a67851d388750bf', + 'WHITAKER_INSTALLER_VERSION': '0.2.5', }), 'permissions': dict({ 'contents': 'read', @@ -147,7 +147,7 @@ 'name': 'Cache Whitaker installation', 'uses': 'actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae', 'with': dict({ - 'key': 'whitaker-v2-${{ runner.os }}-${{ env.WHITAKER_INSTALLER_REV }}', + 'key': 'whitaker-v3-${{ runner.os }}-${{ env.WHITAKER_INSTALLER_VERSION }}', 'path': ''' ~/.cargo/bin/whitaker-installer ~/.local/bin/whitaker @@ -160,17 +160,16 @@ dict({ 'env': dict({ 'RUSTFLAGS': '', + 'WHITAKER_CACHE_HIT': '${{ steps.cache-whitaker.outputs.cache-hit }}', }), 'name': 'Install Whitaker', 'run': ''' set -euo pipefail - echo "Whitaker cache hit: ${{ steps.cache-whitaker.outputs.cache-hit }}" - if [ "${{ steps.cache-whitaker.outputs.cache-hit }}" != "true" ]; then - echo "Installing Whitaker installer at ${WHITAKER_INSTALLER_REV}" - cargo install --locked \ - --git https://github.com/leynos/whitaker \ - --rev "${WHITAKER_INSTALLER_REV}" \ - whitaker-installer + echo "Whitaker cache hit: ${WHITAKER_CACHE_HIT}" + if [ "${WHITAKER_CACHE_HIT}" != "true" ]; then + echo "Installing whitaker-installer ${WHITAKER_INSTALLER_VERSION}" + cargo binstall --no-confirm --locked \ + whitaker-installer@"${WHITAKER_INSTALLER_VERSION}" fi whitaker-installer --cranelift echo "Whitaker binary: $(command -v whitaker || true)"