Run stack-test regularly to keep cache warm

This commit is contained in:
Bryan Richter 2026-04-13 09:36:45 +03:00
parent e84c1a82be
commit e9456a0e30
No known key found for this signature in database
GPG Key ID: B202264020068BFB
3 changed files with 35 additions and 19 deletions

View File

@ -9,25 +9,7 @@ concurrency:
cancel-in-progress: true
jobs:
stack-test:
name: stack test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell/ghcup-setup@v1
id: ghcup
with:
stack-hook: true
- uses: actions/cache@v4
with:
path: |
${{ steps.ghcup.outputs.basedir }}
~/.stack
key: stack-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
restore-keys: |
stack-${{ runner.os }}-
${{ runner.os }}-
- run: ghcup install stack
- run: stack test
uses: ./.github/workflows/stack-test.yml
flake-no-push:
name: flake check (no push)

9
.github/workflows/cache-warmup.yaml vendored Normal file
View File

@ -0,0 +1,9 @@
name: biweekly cache warmup
on:
schedule:
# Every Monday and Thursday at 11:23 UTC
- cron: '23 11 * * mon,thu'
workflow_dispatch:
jobs:
stack-test:
uses: ./.github/workflows/stack-test.yml

25
.github/workflows/stack-test.yml vendored Normal file
View File

@ -0,0 +1,25 @@
# Reusable workflow used by the others. Not called directly usually.
name: stack test
on:
workflow_call:
jobs:
stack-test:
name: stack test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell/ghcup-setup@v1
id: ghcup
with:
stack-hook: true
- uses: actions/cache@v4
with:
path: |
${{ steps.ghcup.outputs.basedir }}
~/.stack
key: stack-${{ runner.os }}-${{ hashFiles('stack.yaml') }}
restore-keys: |
stack-${{ runner.os }}-
${{ runner.os }}-
- run: ghcup install stack
- run: stack test