3 # See: https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#concurrency.
5 group: ${{ github.ref }}-${{ github.workflow }}
6 cancel-in-progress: true
18 GHC_FOR_QUICK_JOBS: 9.6.5
23 runs-on: ubuntu-latest
26 cabal build --builddir=dist-newstyle-meta --project-file=cabal.meta.project
32 - name: Install primary compiler
33 uses: haskell-actions/setup@v2
36 ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }}
38 - name: Haskell versions
42 - name: Update Hackage index
44 - uses: actions/checkout@v4
45 - name: Generate build plan for correct cache key
46 run: ${{ env.cabal_build }} --dry-run
47 - name: Restore cached dependencies
48 uses: actions/cache/restore@v4
51 path: ~/.local/state/cabal
52 key: linux-store-meta-${{ hashfiles('dist-newstyle-meta/cache/plan.json') }}
53 restore-keys: linux-store-meta-
55 run: ${{ env.cabal_build }}
56 - name: Regenerate files
60 - name: Check that diff is clean
62 git status > /dev/null
63 git diff-files -p --exit-code
64 - name: Cache dependencies
65 uses: actions/cache/save@v4
66 if: always() && steps.cache.outputs.cache-hit != 'true'
68 path: ~/.local/state/cabal
69 key: ${{ steps.cache.outputs.cache-primary-key }}
73 runs-on: ubuntu-latest
75 - name: Install primary compiler
76 uses: haskell-actions/setup@v2
79 ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }}
81 - name: Haskell versions
85 # It is complicated to get a proper cache key for the dependencies of a package
86 # (here: doctest) that we just `cabal install`.
87 # So, as a heuristics we update the cache once per day.
88 # Updating it with each run would be an alternative, but we a short of cache space,
89 # and this would generate too many new caches.
90 - name: Use date as cache key
92 echo "DATE=$(date +'%Y-%m-%d')" >> "${GITHUB_ENV}"
93 - name: Restore cached dependencies
94 uses: actions/cache/restore@v4
97 path: ~/.local/state/cabal
98 key: linux-store-doctest-${{ env.DATE }}
99 restore-keys: linux-store-doctest
100 - name: Update Hackage index
102 - uses: actions/checkout@v4
103 - name: Install doctest
104 run: make doctest-install
107 - name: Cache dependencies
108 if: always() && steps.cache.outputs.cache-hit != 'true'
109 uses: actions/cache/save@v4
111 path: ~/.local/state/cabal
112 key: ${{ steps.cache.outputs.cache-primary-key }}
115 name: Check Field Syntax Reference
116 runs-on: ubuntu-latest
118 cabal_build: cabal build buildinfo-reference-generator
120 - name: Install primary compiler
121 uses: haskell-actions/setup@v2
124 ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }}
125 cabal-version: latest
126 - name: Haskell versions
130 - name: Update Hackage index
132 - uses: actions/checkout@v4
133 - name: Generate build plan for correct cache key
134 run: ${{ env.cabal_build }} --dry-run
135 - name: Restore cached dependencies
136 uses: actions/cache/restore@v4
139 path: ~/.local/state/cabal
140 key: linux-store-buildinfo-doc-diff-${{ hashfiles('dist-newstyle/cache/plan.json') }}
141 restore-keys: linux-store-buildinfo-doc-diff
142 - name: Build buildinfo-reference-generator
143 run: ${{ env.cabal_build }}
144 - name: Are buildinfo docs up to date?
145 run: make doc/buildinfo-fields-reference.rst
146 - name: Cache dependencies
147 uses: actions/cache/save@v4
148 if: always() && steps.cache.outputs.cache-hit != 'true'
150 path: ~/.local/state/cabal
151 key: ${{ steps.cache.outputs.cache-primary-key }}
154 name: Check Release Project
155 runs-on: ubuntu-latest
157 - name: Install primary compiler
158 uses: haskell-actions/setup@v2
161 ghc-version: ${{ env.GHC_FOR_QUICK_JOBS }}
162 cabal-version: latest
163 - name: Haskell versions
167 - name: Update Hackage Index
169 - uses: actions/checkout@v4
170 - name: Check Release with Pinned Hackage
171 run: cabal build all --dry-run --project-file=cabal.release.project
172 - name: Check Release with Latest Hackage
173 run: cabal build all --dry-run --project-file=cabal.release.project --index-state="hackage.haskell.org HEAD"