-
Notifications
You must be signed in to change notification settings - Fork 697
94 lines (91 loc) · 2.88 KB
/
quick-jobs.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
name: Quick jobs
# See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
release:
types:
- created
jobs:
meta:
name: Meta checks
runs-on: ubuntu-latest
# This job is not run in a container, any recent GHC should be fine
steps:
- name: Set PATH
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- uses: actions/cache@v3
with:
path: ~/.cabal/store
key: linux-store-meta
# 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 ls -lah /usr/local/.ghcup/cache
sudo mkdir -p /usr/local/.ghcup/cache
sudo ls -lah /usr/local/.ghcup/cache
sudo chown -R $USER /usr/local/.ghcup
sudo chmod -R 777 /usr/local/.ghcup
fi
- name: ghcup
run: |
ghcup --version
ghcup config set cache true
ghcup install ghc recommended
ghcup set ghc recommended
- name: Update Hackage index
run: cabal v2-update
- name: Install alex
run: cabal v2-install alex --constraint='alex ==3.2.7.3'
- uses: actions/checkout@v3
- name: Regenerate files
run: |
make -B lexer
make -B spdx
make -B templates
- name: Check that diff is clean
run: |
git status > /dev/null
git diff-files -p --exit-code
doctest:
name: Doctest Cabal
runs-on: ubuntu-latest
steps:
- name: Set PATH
run: |
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
- uses: actions/cache@v3
with:
path: ~/.cabal/store
key: linux-store-doctest
# 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 ls -lah /usr/local/.ghcup/cache
sudo mkdir -p /usr/local/.ghcup/cache
sudo ls -lah /usr/local/.ghcup/cache
sudo chown -R $USER /usr/local/.ghcup
sudo chmod -R 777 /usr/local/.ghcup
fi
- name: ghcup
run: |
ghcup --version
ghcup config set cache true
ghcup install ghc --set recommended
ghcup install cabal --set latest
- name: Update Hackage index
run: cabal v2-update
- uses: actions/checkout@v3
- name: Install doctest
run: make doctest-install
- name: Doctest
run: make doctest