added formatting CI task

This commit is contained in:
Jack Hodgkinson 2022-02-09 14:52:44 +00:00
parent 51da0cf080
commit ed160faa50
3 changed files with 38 additions and 13 deletions

5
.github/format.sh vendored Normal file
View file

@ -0,0 +1,5 @@
#!/bin/bash
nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/refs/tags/21.05.tar.gz \
-p haskellPackages.fourmolu \
--run 'make format_check'

33
.github/workflows/integrate.yaml vendored Normal file
View file

@ -0,0 +1,33 @@
on:
push:
paths:
- "**.hs"
- "**.nix"
- "flake.lock"
- "agora.cabal"
branches:
- master
pull_request:
paths:
- "**.hs"
- "**.nix"
- "flake.lock"
- "agora.cabal"
jobs:
check-formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2.1.4
name: Cache Stack
with:
path: ~/.stack
key: ${{ runner.os }}-stack-formatting
restore-keys: ${{ runner.os }}-stack-
- run: stack install fourmolu
name: Setup
- run: ./.github/format.sh
name: "Run fourmolu"

View file

@ -1,13 +0,0 @@
name: learn-github-actions
on: [push]
jobs:
check-bats-version:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '14'
- run: npm install -g bats
- run: bats -v