Skip to content

Commit 1df5524

Browse files
authored
copy over the master version of quick-jobs.yml
1 parent d02e962 commit 1df5524

File tree

1 file changed

+56
-94
lines changed

1 file changed

+56
-94
lines changed

.github/workflows/quick-jobs.yml

Lines changed: 56 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,6 @@ jobs:
2121
meta:
2222
name: Meta checks
2323
runs-on: ubuntu-latest
24-
<<<<<<< HEAD
25-
# This job is not run in a container, any recent GHC should be fine
26-
steps:
27-
- name: Set PATH
28-
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
29-
=======
3024
env:
3125
cabal_build: >-
3226
cabal build --builddir=dist-newstyle-meta --project-file=cabal.meta.project
@@ -42,50 +36,42 @@ jobs:
4236
ghcup install ghc $GHC_FOR_QUICK_JOBS
4337
ghcup set ghc $GHC_FOR_QUICK_JOBS
4438
- name: Haskell versions
45-
>>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
46-
run: |
47-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
48-
- uses: actions/cache@v3
49-
with:
50-
path: ~/.cabal/store
51-
key: linux-store-meta
52-
# See https://github.com/haskell/cabal/pull/8739
53-
- name: Sudo chmod to permit ghcup to update its cache
5439
run: |
55-
if [[ "${{ runner.os }}" == "Linux" ]]; then
56-
sudo ls -lah /usr/local/.ghcup/cache
57-
sudo mkdir -p /usr/local/.ghcup/cache
58-
sudo ls -lah /usr/local/.ghcup/cache
59-
sudo chown -R $USER /usr/local/.ghcup
60-
sudo chmod -R 777 /usr/local/.ghcup
61-
fi
62-
- name: ghcup
63-
run: |
64-
ghcup --version
65-
ghcup config set cache true
66-
ghcup install ghc recommended
67-
ghcup set ghc recommended
40+
ghc --version
41+
cabal --version
6842
- name: Update Hackage index
6943
run: cabal v2-update
70-
- name: Install alex
71-
run: cabal v2-install alex --constraint='alex ==3.2.7.3'
7244
- 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
49+
id: cache
50+
with:
51+
path: ~/.local/state/cabal
52+
key: linux-store-meta-${{ hashfiles('dist-newstyle-meta/cache/plan.json') }}
53+
restore-keys: linux-store-meta-
54+
- name: Build tools
55+
run: ${{ env.cabal_build }}
7356
- name: Regenerate files
7457
run: |
75-
make -B lexer
7658
make -B spdx
7759
make -B templates
7860
- name: Check that diff is clean
7961
run: |
8062
git status > /dev/null
8163
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'
67+
with:
68+
path: ~/.local/state/cabal
69+
key: ${{ steps.cache.outputs.cache-primary-key }}
70+
8271
doctest:
8372
name: Doctest Cabal
8473
runs-on: ubuntu-latest
8574
steps:
86-
<<<<<<< HEAD
87-
- name: Set PATH
88-
=======
8975
- name: ghcup
9076
run: |
9177
ghcup --version
@@ -102,110 +88,86 @@ jobs:
10288
# Updating it with each run would be an alternative, but we a short of cache space,
10389
# and this would generate too many new caches.
10490
- name: Use date as cache key
105-
>>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
10691
run: |
107-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
108-
- uses: actions/cache@v3
92+
echo "DATE=$(date +'%Y-%m-%d')" >> "${GITHUB_ENV}"
93+
- name: Restore cached dependencies
94+
uses: actions/cache/restore@v4
95+
id: cache
10996
with:
110-
path: ~/.cabal/store
111-
key: linux-store-doctest
112-
# See https://github.com/haskell/cabal/pull/8739
113-
- name: Sudo chmod to permit ghcup to update its cache
114-
run: |
115-
if [[ "${{ runner.os }}" == "Linux" ]]; then
116-
sudo ls -lah /usr/local/.ghcup/cache
117-
sudo mkdir -p /usr/local/.ghcup/cache
118-
sudo ls -lah /usr/local/.ghcup/cache
119-
sudo chown -R $USER /usr/local/.ghcup
120-
sudo chmod -R 777 /usr/local/.ghcup
121-
fi
122-
- name: ghcup
123-
run: |
124-
ghcup --version
125-
ghcup config set cache true
126-
ghcup install ghc --set recommended
127-
ghcup install cabal --set latest
97+
path: ~/.local/state/cabal
98+
key: linux-store-doctest-${{ env.DATE }}
99+
restore-keys: linux-store-doctest
128100
- name: Update Hackage index
129101
run: cabal v2-update
130102
- uses: actions/checkout@v4
131103
- name: Install doctest
132104
run: make doctest-install
133105
- name: Doctest
134106
run: make doctest
107+
- name: Cache dependencies
108+
if: always() && steps.cache.outputs.cache-hit != 'true'
109+
uses: actions/cache/save@v4
110+
with:
111+
path: ~/.local/state/cabal
112+
key: ${{ steps.cache.outputs.cache-primary-key }}
113+
135114
buildinfo:
136115
name: Check Field Syntax Reference
137116
runs-on: ubuntu-latest
117+
env:
118+
cabal_build: cabal build buildinfo-reference-generator
138119
steps:
139-
<<<<<<< HEAD
140-
- name: Set PATH
141-
run: |
142-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
143-
- uses: actions/cache@v3
144-
with:
145-
path: ~/.cabal/store
146-
key: linux-store-buildinfo-doc-diff
147-
# See https://github.com/haskell/cabal/pull/8739
148-
- name: Sudo chmod to permit ghcup to update its cache
149-
run: |
150-
if [[ "${{ runner.os }}" == "Linux" ]]; then
151-
sudo ls -lah /usr/local/.ghcup/cache
152-
sudo mkdir -p /usr/local/.ghcup/cache
153-
sudo ls -lah /usr/local/.ghcup/cache
154-
sudo chown -R $USER /usr/local/.ghcup
155-
sudo chmod -R 777 /usr/local/.ghcup
156-
fi
157-
=======
158-
>>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
159120
- name: ghcup
160121
run: |
161122
ghcup --version
162123
ghcup config set cache true
163-
<<<<<<< HEAD
164-
ghcup install ghc --set recommended
165-
ghcup install cabal --set latest
166-
=======
167124
ghcup install ghc $GHC_FOR_QUICK_JOBS
168125
ghcup set ghc $GHC_FOR_QUICK_JOBS
169126
- name: Haskell versions
170127
run: |
171128
ghc --version
172129
cabal --version
173-
>>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
174130
- name: Update Hackage index
175131
run: cabal v2-update
176132
- 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
137+
id: cache
138+
with:
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 }}
177144
- name: Are buildinfo docs up to date?
178145
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'
149+
with:
150+
path: ~/.local/state/cabal
151+
key: ${{ steps.cache.outputs.cache-primary-key }}
152+
179153
release-project:
180154
name: Check Release Project
181155
runs-on: ubuntu-latest
182156
steps:
183-
<<<<<<< HEAD
184-
- name: Set PATH
185-
run: |
186-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
187-
=======
188-
>>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
189157
- name: ghcup
190158
run: |
191159
ghcup --version
192160
ghcup config set cache true
193-
<<<<<<< HEAD
194-
ghcup install ghc --set recommended
195-
ghcup install cabal --set latest
196-
=======
197161
ghcup install ghc $GHC_FOR_QUICK_JOBS
198162
ghcup set ghc $GHC_FOR_QUICK_JOBS
199163
- name: Haskell versions
200164
run: |
201165
ghc --version
202166
cabal --version
203-
>>>>>>> 305033b30 (ci: Fix quick-jobs GHC version to 9.6 (#10026))
204167
- name: Update Hackage Index
205168
run: cabal v2-update
206169
- uses: actions/checkout@v4
207170
- name: Check Release with Pinned Hackage
208-
run: cabal build all --dry-run --project-file=cabal.project.release
171+
run: cabal build all --dry-run --project-file=cabal.release.project
209172
- name: Check Release with Latest Hackage
210-
run: cabal build all --dry-run --project-file=cabal.project.release --index-state="hackage.haskell.org HEAD"
211-
173+
run: cabal build all --dry-run --project-file=cabal.release.project --index-state="hackage.haskell.org HEAD"

0 commit comments

Comments
 (0)