14 runs-on: ubuntu-latest
17 fix-whitespace-ver: '0.0.10'
20 - uses: actions/checkout@v3
21 name: Checkout sources
23 - name: Create directory for binary
25 mkdir -p $HOME/.local/bin
27 - uses: actions/cache@v3
28 name: Cache the binary
32 key: fix-whitespace-${{ env.fix-whitespace-ver }}
34 # See https://github.com/haskell/cabal/pull/8739
35 - name: Sudo chmod to permit ghcup to update its cache
37 if [[ "${{ runner.os }}" == "Linux" ]]; then
38 sudo mkdir -p /usr/local/.ghcup/cache
39 sudo chown -R $USER /usr/local/.ghcup
40 sudo chmod -R 777 /usr/local/.ghcup
43 - uses: haskell/actions/setup@v2
44 if: ${{ !steps.cache.outputs.cache-hit }}
49 - name: Install fix-whitespace
50 if: ${{ !steps.cache.outputs.cache-hit }}
52 cabal install --ignore-project --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-${{ env.fix-whitespace-ver }}
53 strip $HOME/.local/bin/fix-whitespace
55 - name: Check the whitespace issue
57 $HOME/.local/bin/fix-whitespace --check