File tree 2 files changed +31
-4
lines changed 2 files changed +31
-4
lines changed Original file line number Diff line number Diff line change @@ -18,12 +18,15 @@ jobs:
18
18
meta :
19
19
name : Meta checks
20
20
runs-on : ubuntu-latest
21
+ env :
22
+ cabal_build : >-
23
+ cabal build --builddir=dist-newstyle-meta --project-file=cabal.project.meta
24
+ gen-cabal-macros
25
+ gen-paths-module
26
+ gen-spdx
27
+ gen-spdx-exc
21
28
# This job is not run in a container, any recent GHC should be fine
22
29
steps :
23
- - uses : actions/cache@v4
24
- with :
25
- path : ~/.local/state/cabal
26
- key : linux-store-meta
27
30
# OBSOLETE: workaround to fix ghcup directory rights.
28
31
# # See https://github.com/haskell/cabal/pull/8739
29
32
# - name: Sudo chmod to permit ghcup to update its cache
44
47
- name : Update Hackage index
45
48
run : cabal v2-update
46
49
- uses : actions/checkout@v4
50
+ - name : Generate build plan for correct cache key
51
+ run : ${{ env.cabal_build }} --dry-run
52
+ - name : Restore cached dependencies
53
+ uses : actions/cache/restore@v4
54
+ id : cache
55
+ with :
56
+ path : ~/.local/state/cabal
57
+ key : linux-store-meta-${{ hashfiles('dist-newstyle-meta/cache/plan.json') }}
58
+ restore-keys : linux-store-meta-
59
+ - name : Build tools
60
+ run : ${{ env.cabal_build }}
47
61
- name : Regenerate files
48
62
run : |
49
63
make -B spdx
52
66
run : |
53
67
git status > /dev/null
54
68
git diff-files -p --exit-code
69
+ - name : Cache dependencies
70
+ uses : actions/cache/save@v4
71
+ if : always() && steps.cache.outputs.cache-hit != 'true'
72
+ with :
73
+ path : ~/.local/state/cabal
74
+ key : ${{ steps.cache.outputs.cache-primary-key }}
75
+
55
76
doctest :
56
77
name : Doctest Cabal
57
78
runs-on : ubuntu-latest
Original file line number Diff line number Diff line change @@ -49,6 +49,9 @@ style-commit: ## Run the code styler on the previous commit
49
49
SPDX_LICENSE_HS: =Cabal-syntax/src/Distribution/SPDX/LicenseId.hs
50
50
SPDX_EXCEPTION_HS: =Cabal-syntax/src/Distribution/SPDX/LicenseExceptionId.hs
51
51
52
+ # Note: the 'spdx' goal is used in .github/workflows/quick-jobs.yml.
53
+ # Any changes to this goal need to be reconciled with this workflow.
54
+ #
52
55
.PHONY : spdx
53
56
spdx : $(SPDX_LICENSE_HS ) $(SPDX_EXCEPTION_HS )
54
57
@@ -65,6 +68,9 @@ $(SPDX_EXCEPTION_HS) : templates/SPDX.LicenseExceptionId.template.hs cabal-dev-s
65
68
TEMPLATE_MACROS: =Cabal/src/Distribution/Simple/Build/Macros/Z.hs
66
69
TEMPLATE_PATHS: =Cabal/src/Distribution/Simple/Build/PathsModule/Z.hs
67
70
71
+ # Note: the 'templates' goal is used in .github/workflows/quick-jobs.yml.
72
+ # Any changes to this goal need to be reconciled with this workflow.
73
+ #
68
74
.PHONY : templates
69
75
templates : $(TEMPLATE_MACROS ) $(TEMPLATE_PATHS )
70
76
You can’t perform that action at this time.
0 commit comments