-
Notifications
You must be signed in to change notification settings - Fork 697
57 lines (48 loc) · 1.41 KB
/
whitespace.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: Assorted
on:
push:
branches:
- master
pull_request:
release:
types:
- created
jobs:
check:
name: Whitespace
runs-on: ubuntu-latest
env:
fix-whitespace-ver: '0.0.10'
steps:
- uses: actions/checkout@v3
name: Checkout sources
- name: Create directory for binary
run: |
mkdir -p $HOME/.local/bin
- uses: actions/cache@v3
name: Cache the binary
id: cache
with:
path: "~/.local/bin"
key: fix-whitespace-${{ env.fix-whitespace-ver }}
# See https://github.com/haskell/cabal/pull/8739
- name: Sudo chmod to permit ghcup to update its cache
run: |
if [[ "${{ runner.os }}" == "Linux" ]]; then
sudo mkdir -p /usr/local/.ghcup/cache
sudo chown -R $USER /usr/local/.ghcup
sudo chmod -R 777 /usr/local/.ghcup
fi
- uses: haskell/actions/setup@v2
if: ${{ !steps.cache.outputs.cache-hit }}
with:
ghc-version: '9.2'
cabal-version: latest
- name: Install fix-whitespace
if: ${{ !steps.cache.outputs.cache-hit }}
run: |
cabal install --constraint=aeson==2.1.2.1 --ignore-project --install-method=copy --installdir=$HOME/.local/bin fix-whitespace-${{ env.fix-whitespace-ver }}
strip $HOME/.local/bin/fix-whitespace
- name: Check the whitespace issue
run: |
$HOME/.local/bin/fix-whitespace --check