From 6691f843a8d1edb8ca20706b03357a25b94ab2e5 Mon Sep 17 00:00:00 2001 From: "G. Allais" Date: Tue, 17 Oct 2023 13:25:31 +0100 Subject: [PATCH] [ ci ] use GHC version as a cache key (#20) --- .github/workflows/generate-website.yml | 10 +++++++--- Generate101.hs | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/generate-website.yml b/.github/workflows/generate-website.yml index 2be1127..dae721f 100644 --- a/.github/workflows/generate-website.yml +++ b/.github/workflows/generate-website.yml @@ -7,6 +7,9 @@ on: schedule: - cron: 10 14 * * * # 10 minutes after 101 slot starts (UTC timezone) +env: + GHC_VERSION: 9.6 + jobs: build-and-deploy: @@ -24,12 +27,13 @@ jobs: filters: | haskell-changed: - '*.hs' + - '.github/workflows/generate-website.yml' - name: Install cabal and GHC if: github.event_name != 'schedule' && steps.changes.outputs.haskell-changed == 'true' uses: haskell-actions/setup@v2 with: - ghc-version: '9.6' + ghc-version: ${{ env.GHC_VERSION }} cabal-version: 'latest' - name: Cache cabal and executables @@ -39,8 +43,8 @@ jobs: ~/.cabal/store ~/_dist ~/.cabal/bin/ - key: cabal-${{ runner.os }}-${{ github.sha }} - restore-keys: cabal-${{ runner.os }} + key: cabal-${{ runner.os }}-${{ env.GHC_VERSION }}-${{ github.sha }} + restore-keys: cabal-${{ runner.os }}-${{ env.GHC_VERSION }} ##### Installation ####################################### - name: Install Generate[101] diff --git a/Generate101.hs b/Generate101.hs index d7c6fda..d0564cd 100644 --- a/Generate101.hs +++ b/Generate101.hs @@ -27,6 +27,7 @@ prettyEncode ts file = do BS.writeFile file $ encodePretty' cfg ts -} +main :: IO () main = do ts <- talks let ts' = filter (not . cancelled . snd) ts