Merge pull request #367 from commercialhaskell/b/cache-warmup

CI cache warmup
This commit is contained in:
Bryan Richter 2026-04-13 10:35:19 +03:00 committed by GitHub
commit 08d08c472f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 49 additions and 36 deletions

22
.github/actions/stack-test/action.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: stack test
description: Build and test with stack
runs:
using: composite
steps:
- 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
shell: bash
- run: stack test
shell: bash

6
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

View File

@ -1,4 +1,5 @@
name: check and push
# CI that runs on pull requests and pushes to master.
name: CI
on:
push:
branches:
@ -12,46 +13,17 @@ jobs:
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: actions/checkout@v6
- uses: ./.github/actions/stack-test
flake-no-push:
name: flake check (no push)
if: github.event_name != 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v15
with:
name: stackage-infrastructure
- run: nix build
- run: nix flake check
flake-push:
flake-check:
name: flake check and push
if: github.event_name == 'push'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6
- uses: cachix/install-nix-action@v31
- uses: cachix/cachix-action@v15
with:
name: stackage-infrastructure
authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}'
- uses: DeterminateSystems/magic-nix-cache-action@v13
- uses: cachix/cachix-action@v17
- run: nix build
- run: nix flake check

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

@ -0,0 +1,13 @@
name: biweekly cache warmup
on:
schedule:
# Every Monday and Thursday at 11:23 UTC
- cron: '23 11 * * mon,thu'
workflow_dispatch:
jobs:
stack-test:
name: stack test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: ./.github/actions/stack-test