mirror of
https://github.com/commercialhaskell/stackage-server.git
synced 2026-06-10 00:02:33 +02:00
Make the reusable workflow a reusable action
This commit is contained in:
parent
a4e934b5e2
commit
29cee69f8a
22
.github/actions/stack-test/action.yml
vendored
Normal file
22
.github/actions/stack-test/action.yml
vendored
Normal 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/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
@ -10,7 +10,11 @@ concurrency:
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
stack-test:
|
||||
uses: ./.github/workflows/stack-test.yml
|
||||
name: stack test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/stack-test
|
||||
|
||||
flake-check:
|
||||
name: flake check and push
|
||||
|
||||
6
.github/workflows/cache-warmup.yaml
vendored
6
.github/workflows/cache-warmup.yaml
vendored
@ -6,4 +6,8 @@ on:
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
stack-test:
|
||||
uses: ./.github/workflows/stack-test.yml
|
||||
name: stack test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- uses: ./.github/actions/stack-test
|
||||
|
||||
25
.github/workflows/stack-test.yml
vendored
25
.github/workflows/stack-test.yml
vendored
@ -1,25 +0,0 @@
|
||||
# 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
|
||||
Loading…
Reference in New Issue
Block a user