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
20 runs-on: ubuntu-latest
23 cabal build --builddir=dist-newstyle-meta --project-file=cabal.project.meta
28 # This job is not run in a container, any recent GHC should be fine
30 # SKIP installation of ghc and cabal and use the preinstalled versions.
34 # ghcup config set cache true
35 # ghcup install ghc recommended
36 # ghcup set ghc recommended
37 - name: Haskell versions
41 - name: Update Hackage index
43 - uses: actions/checkout@v4
44 - name: Generate build plan for correct cache key
45 run: ${{ env.cabal_build }} --dry-run
46 - name: Restore cached dependencies
47 uses: actions/cache/restore@v4
50 path: ~/.local/state/cabal
51 key: linux-store-meta-${{ hashfiles('dist-newstyle-meta/cache/plan.json') }}
52 restore-keys: linux-store-meta-
54 run: ${{ env.cabal_build }}
55 - name: Regenerate files
59 - name: Check that diff is clean
61 git status > /dev/null
62 git diff-files -p --exit-code
63 - name: Cache dependencies
64 uses: actions/cache/save@v4
65 if: always() && steps.cache.outputs.cache-hit != 'true'
67 path: ~/.local/state/cabal
68 key: ${{ steps.cache.outputs.cache-primary-key }}
72 runs-on: ubuntu-latest
74 # It is complicated to get a proper cache key for the dependencies of a package
75 # (here: doctest) that we just `cabal install`.
76 # So, as a heuristics we update the cache once per day.
77 # Updating it with each run would be an alternative, but we a short of cache space,
78 # and this would generate too many new caches.
79 - name: Use date as cache key
81 echo "DATE=$(date +'%Y-%m-%d')" >> "${GITHUB_ENV}"
82 - name: Restore cached dependencies
83 uses: actions/cache/restore@v4
86 path: ~/.local/state/cabal
87 key: linux-store-doctest-${{ env.DATE }}
88 restore-keys: linux-store-doctest
89 - name: Update Hackage index
91 - uses: actions/checkout@v4
92 - name: Install doctest
93 run: make doctest-install
96 - name: Cache dependencies
97 if: always() && steps.cache.outputs.cache-hit != 'true'
98 uses: actions/cache/save@v4
100 path: ~/.local/state/cabal
101 key: ${{ steps.cache.outputs.cache-primary-key }}
104 name: Check Field Syntax Reference
105 runs-on: ubuntu-latest
107 cabal_build: cabal build buildinfo-reference-generator
109 - name: Update Hackage index
111 - uses: actions/checkout@v4
112 - name: Generate build plan for correct cache key
113 run: ${{ env.cabal_build }} --dry-run
114 - name: Restore cached dependencies
115 uses: actions/cache/restore@v4
118 path: ~/.local/state/cabal
119 key: linux-store-buildinfo-doc-diff-${{ hashfiles('dist-newstyle/cache/plan.json') }}
120 restore-keys: linux-store-buildinfo-doc-diff
121 - name: Build buildinfo-reference-generator
122 run: ${{ env.cabal_build }}
123 - name: Are buildinfo docs up to date?
124 run: make doc/buildinfo-fields-reference.rst
125 - name: Cache dependencies
126 uses: actions/cache/save@v4
127 if: always() && steps.cache.outputs.cache-hit != 'true'
129 path: ~/.local/state/cabal
130 key: ${{ steps.cache.outputs.cache-primary-key }}
133 name: Check Release Project
134 runs-on: ubuntu-latest
136 - name: Update Hackage Index
138 - uses: actions/checkout@v4
139 - name: Check Release with Pinned Hackage
140 run: cabal build all --dry-run --project-file=cabal.project.release
141 - name: Check Release with Latest Hackage
142 run: cabal build all --dry-run --project-file=cabal.project.release --index-state="hackage.haskell.org HEAD"