Skip to content

GitHub Actions: Revise workflow #17

GitHub Actions: Revise workflow

GitHub Actions: Revise workflow #17

Workflow file for this run

name: Haskell CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
install-stack:
runs-on: ubuntu-latest
steps:
- name: Restore cached ~/.stack
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.local/bin/stack
~/.stack
key: test-${{ runner.os }}-${{ hashFiles('stack.lts.yaml') }}
- run: |
if [ ! -f ~/.local/bin/stack ]; then
curl -sSL https://get.haskellstack.org/ | sh -s - -f
fi
- name: Save ~/.stack
uses: actions/cache/save@v4
with:
path: |
~/.local/bin/stack
~/.stack
key: test-${{ runner.os }}-${{ hashFiles('stack.lts.yaml') }}
stack-test:
runs-on: ubuntu-latest
needs: install-stack
steps:
- uses: actions/checkout@v4
- name: Restore cached ~/.stack
id: cache-restore
uses: actions/cache/restore@v4
with:
path: |
~/.local/bin/stack
~/.stack
key: test-${{ runner.os }}-${{ hashFiles('stack.lts.yaml') }}
- if: steps.cache-restore.outputs.cache-hit != 'true'
run: exit 1
- run: |
~/.local/bin/stack init
~/.local/bin/stack test
- name: Save ~/.stack
uses: actions/cache/save@v4
with:
path: |
~/.local/bin/stack
~/.stack
key: test-${{ runner.os }}-${{ hashFiles('stack.lts.yaml') }}
fourmolu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore cached fourmolu
uses: actions/cache/restore@v4
with:
path: ~/.local/bin/fourmolu
key: fourmolu-0.16.2.0
- run: |
if [ ! -f ~/.local/bin/fourmolu ]; then
mkdir -p ~/.local/bin
curl -o ~/.local/bin/fourmolu -L https://github.com/fourmolu/fourmolu/releases/download/v0.16.2.0/fourmolu-0.16.2.0-linux-x86_64
chmod +x ~/.local/bin/fourmolu
fi
- name: Save fourmolu cache
uses: actions/cache/save@v4
with:
path: ~/.local/bin/fourmolu
key: fourmolu-0.16.2.0
- run: ~/.local/bin/fourmolu --mode check src test
hlint:
needs: restore

Check failure on line 88 in .github/workflows/haskell.yml

View workflow run for this annotation

GitHub Actions / Haskell CI

Invalid workflow file

The workflow is not valid. .github/workflows/haskell.yml (Line: 88, Col: 12): Job 'hlint' depends on unknown job 'restore'.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Restore cached hlint
uses: actions/cache/restore@v4
with:
path: ~/.local/bin/hlint
key: hlint-3.8
- run: |
if [ ! -f ~/.local/bin/hlint ]; then
mkdir -p ~/.local/bin
curl -o /tmp/hlint.tar.gz -L https://github.com/ndmitchell/hlint/releases/download/v3.8/hlint-3.8-x86_64-linux.tar.gz
tar xzf /tmp/hlint.tar.gz --directory=/tmp
cp /tmp/hlint-3.8/hlint ~/.local/bin/hlint
fi
- name: Save hlint cache
uses: actions/cache/save@v4
with:
path: ~/.local/bin/hlint
key: hlint-3.8
- run: ~/.local/bin/hlint src test