Skip to content

GHA: fix caching in lint-generate-readme job #756

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
9 changes: 6 additions & 3 deletions .github/actions/generate-readme/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ inputs:
required: true
description: "Version of cabal"
hackage-index-state:
required: false
required: true
description: "Timestamp for Hackage index"
runs:
using: composite
Expand All @@ -25,10 +25,13 @@ runs:
id: cache-cabal
with:
path: ${{ steps.setup-haskell.outputs.cabal-store }}
key: generate-readme-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}
key: generate-readme-${{ runner.os }}-ghc-${{ steps.setup-haskell.outputs.ghc-version }}-cabal-${{ steps.setup-haskell.outputs.cabal-version }}-input-state-${{ inputs.hackage-index-state }}

- name: 🛠️ Generate README.md
run: ./scripts/generate-readme.hs
run: |
cabal run \
${{ inputs.hackage-index-state && format('--index-state={0}', inputs.hackage-index-state) }} \
./scripts/generate-readme.hs
shell: sh

- name: 💾 Save Cabal dependencies
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,6 @@ jobs:
with:
ghc-version: ${{ env.DEFAULT_GHC_VERSION }}
cabal-version: ${{ env.DEFAULT_CABAL_VERSION }}
# The index-state is fixed to enable caching and ensure that the version
# regardless of the current state of Hackage head.
# If you want a newer version of cabal-fmt, use a more recent time.
hackage-index-state: "2025-05-22T00:00:00Z"

- name: 🎗️ Lint with generate-readme
Expand Down