GHC 9.8 compat: pacify -Wx-partial
[cabal.git] / .github / workflows / quick-jobs.yml
blob9426ed7972415574ec97928bdac41af05574f766
1 name: Quick jobs
3 # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
4 concurrency:
5   group: ${{ github.ref }}-${{ github.workflow }}
6   cancel-in-progress: true
8 on:
9   push:
10     branches:
11       - master
12   pull_request:
13   release:
14     types:
15       - created
17 jobs:
18   meta:
19     name: Meta checks
20     runs-on: ubuntu-latest
21     # This job is not run in a container, any recent GHC should be fine
22     steps:
23       - name: Set PATH
24         # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
25         run: |
26           echo "$HOME/.cabal/bin" >> $GITHUB_PATH
27       - uses: actions/cache@v3
28         with:
29           path: ~/.cabal/store
30           key: linux-store-meta
31       # See https://github.com/haskell/cabal/pull/8739
32       - name: Sudo chmod to permit ghcup to update its cache
33         run: |
34           if [[ "${{ runner.os }}" == "Linux" ]]; then
35             sudo ls -lah /usr/local/.ghcup/cache
36             sudo mkdir -p /usr/local/.ghcup/cache
37             sudo ls -lah /usr/local/.ghcup/cache
38             sudo chown -R $USER /usr/local/.ghcup
39             sudo chmod -R 777 /usr/local/.ghcup
40           fi
41       - name: ghcup
42         run: |
43           ghcup --version
44           ghcup config set cache true
45           ghcup install ghc recommended
46           ghcup set ghc recommended
47       - name: Update Hackage index
48         run: cabal v2-update
49       - name: Install alex
50         run: cabal v2-install alex --constraint='alex ==3.2.7.3'
51       - uses: actions/checkout@v4
52       - name: Regenerate files
53         run: |
54           make -B lexer
55           make -B spdx
56           make -B templates
57       - name: Check that diff is clean
58         run: |
59           git status > /dev/null
60           git diff-files -p --exit-code
61   doctest:
62     name: Doctest Cabal
63     runs-on: ubuntu-latest
64     steps:
65       - name: Set PATH
66         run: |
67           echo "$HOME/.cabal/bin" >> $GITHUB_PATH
68       - uses: actions/cache@v3
69         with:
70           path: ~/.cabal/store
71           key: linux-store-doctest
72       # See https://github.com/haskell/cabal/pull/8739
73       - name: Sudo chmod to permit ghcup to update its cache
74         run: |
75           if [[ "${{ runner.os }}" == "Linux" ]]; then
76             sudo ls -lah /usr/local/.ghcup/cache
77             sudo mkdir -p /usr/local/.ghcup/cache
78             sudo ls -lah /usr/local/.ghcup/cache
79             sudo chown -R $USER /usr/local/.ghcup
80             sudo chmod -R 777 /usr/local/.ghcup
81           fi
82       - name: ghcup
83         run: |
84           ghcup --version
85           ghcup config set cache true
86           ghcup install ghc --set recommended
87           ghcup install cabal --set latest
88       - name: Update Hackage index
89         run: cabal v2-update
90       - uses: actions/checkout@v4
91       - name: Install doctest
92         run: make doctest-install
93       - name: Doctest
94         run: make doctest