Skip to content

Backwards compatible formatting #793

Backwards compatible formatting

Backwards compatible formatting #793

Workflow file for this run

name: Backwards compatible formatting
on:
pull_request:
push:
branches:
- main
schedule:
- cron: '0 0 * * *' # nightly
jobs:
format_compat:
strategy:
fail-fast: false
matrix:
include:
-
name: cabal
repo: haskell/cabal
ref: Cabal-v3.12.0.0
args: Cabal Cabal-syntax cabal-install
-
name: swarm
repo: swarm-game/swarm
ref: 0.4.0.0
args: src app test
name: 'format_compat: ${{ matrix.name }}'
runs-on: ubuntu-latest
steps:
-
name: Check out Fourmolu
uses: actions/checkout@v4
with:
path: fourmolu
-
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-format_compat-${{ hashFiles('fourmolu/stack.yaml', 'fourmolu/fourmolu.cabal') }}
-
name: Install fourmolu
working-directory: fourmolu
run: |
stack install
echo "${HOME}/.local/bin" >> "${GITHUB_PATH}"
-
name: Check out ${{ matrix.repo }}
uses: actions/checkout@v4
with:
repository: ${{ matrix.repo }}
ref: ${{ matrix.ref }}
path: target/
-
name: Run fourmolu
working-directory: target
run: |
git apply --allow-empty ../fourmolu/compat-tests/${{ matrix.name }}.diff
fourmolu -i ${{ matrix.args }}
git -c 'diff.algorithm=histogram' diff > ${{ matrix.name }}.diff
-
name: Compare diff
run: diff -u fourmolu/compat-tests/${{ matrix.name }}.diff target/${{ matrix.name }}.diff
-
if: always()
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.name }}-compat-diff
path: target/${{ matrix.name }}.diff