Skip to content

Lint jobs on solution branch #12

Lint jobs on solution branch

Lint jobs on solution branch #12

Workflow file for this run

on:
workflow_dispatch:
pull_request:
push:
branches:
- master
schedule:
- cron: '23 14 * * 2'
release:
name: build
jobs:
lint:
name: "Run hlint"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up HLint
uses: haskell-actions/hlint-setup@v2
- name: Run HLint
uses: haskell-actions/hlint-run@v2
with:
fail-on: warning
fourmolu:
name: "Run fourmolu"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/run-fourmolu@v9
with:
version: "0.11.0.0"
lint-solution:
name: "Run hlint on the solution branch"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:

Check failure on line 42 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/ci.yml

Invalid workflow file

You have an error in your yaml syntax on line 42
ref: solution
- name: Set up HLint
uses: haskell-actions/hlint-setup@v2
- name: Run HLint
uses: haskell-actions/hlint-run@v2
with:
fail-on: warning
fourmolu-solution:
name: "Run fourmolu on the solution branch"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: solution
- uses: haskell-actions/run-fourmolu@v9
with:
version: "0.11.0.0"
generateMatrix:
name: "Generate matrix from cabal"
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Checkout base repo
uses: actions/checkout@v4
- name: Extract the tested GHC versions
id: set-matrix
run: |
wget https://github.com/Kleidukos/get-tested/releases/download/v0.1.5.0/get-tested-0.1.5.0-linux-amd64 -O get-tested
chmod +x get-tested
./get-tested --ubuntu rhine-koans.cabal >> $GITHUB_OUTPUT
build-cabal:
runs-on: ubuntu-latest
needs: generateMatrix
strategy:
matrix: ${{ fromJSON(needs.generateMatrix.outputs.matrix) }}
name: Haskell GHC ${{ matrix.ghc }} cabal
steps:
- uses: actions/checkout@v4
- uses: haskell-actions/setup@v2
id: setup
with:
ghc-version: ${{ matrix.ghc }}
- name: Cache Cabal build artifacts
uses: actions/cache@v3
with:
path: |
${{ steps.setup-haskell-build.outputs.cabal-store }}
dist-newstyle
key: ${{ runner.os }}-cabal-${{ matrix.ghc }}
restore-keys: |
${{ runner.os }}-cabal-${{ matrix.ghc }}
- name: Cabal build dependencies
run: cabal build all --enable-tests --only-dependencies
- name: Check whether solution branch only contains diffs in the Koans
run: |
git remote
git remote show origin
git fetch origin solution
git diff origin/solution --exit-code -- ':(exclude)koans/**/Koan.hs'
- name: Check out solution branch
uses: actions/checkout@v4
with:
ref: solution
- name: Cabal build solutions
run: cabal build all --enable-tests -fdev
- name: Cabal test solutions
run: cabal test all --enable-tests --test-show-details=Always
success:
name: All GHCs built successfully
runs-on: ubuntu-latest
needs: build-cabal
steps:
- name: Success
run: echo "Success"