Skip to content

Commit e916cb5

Browse files
committed
Fix #9815: switch quick-jobs CI to XDG
Fix #9815: - Cache `~/.local/state/cabal` instead of `~/.cabal/store` - `~/.local/bin` is used instead of `~/.cabal/bin` and is already in the PATH (verify this by calling `alex` after installing it) As I am passing by: - bump cache action to v4 - double-quote `$USER` to keep actionlint happy - move `if` from shell-level to job-level - allow newest `alex`
1 parent 381e82b commit e916cb5

File tree

1 file changed

+14
-30
lines changed

1 file changed

+14
-30
lines changed

.github/workflows/quick-jobs.yml

Lines changed: 14 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,19 @@ jobs:
2020
runs-on: ubuntu-latest
2121
# This job is not run in a container, any recent GHC should be fine
2222
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
23+
- uses: actions/cache@v4
2824
with:
29-
path: ~/.cabal/store
25+
path: ~/.local/state/cabal
3026
key: linux-store-meta
3127
# See https://github.com/haskell/cabal/pull/8739
3228
- name: Sudo chmod to permit ghcup to update its cache
29+
if: runner.os == 'Linux'
3330
run: |
34-
if [[ "${{ runner.os }}" == "Linux" ]]; then
3531
sudo ls -lah /usr/local/.ghcup/cache
3632
sudo mkdir -p /usr/local/.ghcup/cache
3733
sudo ls -lah /usr/local/.ghcup/cache
38-
sudo chown -R $USER /usr/local/.ghcup
34+
sudo chown -R "${USER}" /usr/local/.ghcup
3935
sudo chmod -R 777 /usr/local/.ghcup
40-
fi
4136
- name: ghcup
4237
run: |
4338
ghcup --version
@@ -47,7 +42,8 @@ jobs:
4742
- name: Update Hackage index
4843
run: cabal v2-update
4944
- name: Install alex
50-
run: cabal v2-install alex --constraint='alex ==3.2.7.3'
45+
run: cabal v2-install alex --constraint='alex >=3.2.7.3'
46+
- run: alex --version
5147
- uses: actions/checkout@v4
5248
- name: Regenerate files
5349
run: |
@@ -62,23 +58,19 @@ jobs:
6258
name: Doctest Cabal
6359
runs-on: ubuntu-latest
6460
steps:
65-
- name: Set PATH
66-
run: |
67-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
68-
- uses: actions/cache@v3
61+
- uses: actions/cache@v4
6962
with:
70-
path: ~/.cabal/store
63+
path: ~/.local/state/cabal
7164
key: linux-store-doctest
7265
# See https://github.com/haskell/cabal/pull/8739
7366
- name: Sudo chmod to permit ghcup to update its cache
67+
if: runner.os == 'Linux'
7468
run: |
75-
if [[ "${{ runner.os }}" == "Linux" ]]; then
7669
sudo ls -lah /usr/local/.ghcup/cache
7770
sudo mkdir -p /usr/local/.ghcup/cache
7871
sudo ls -lah /usr/local/.ghcup/cache
79-
sudo chown -R $USER /usr/local/.ghcup
72+
sudo chown -R "${USER}" /usr/local/.ghcup
8073
sudo chmod -R 777 /usr/local/.ghcup
81-
fi
8274
- name: ghcup
8375
run: |
8476
ghcup --version
@@ -96,23 +88,19 @@ jobs:
9688
name: Check Field Syntax Reference
9789
runs-on: ubuntu-latest
9890
steps:
99-
- name: Set PATH
100-
run: |
101-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
102-
- uses: actions/cache@v3
91+
- uses: actions/cache@v4
10392
with:
104-
path: ~/.cabal/store
93+
path: ~/.local/state/cabal
10594
key: linux-store-buildinfo-doc-diff
10695
# See https://github.com/haskell/cabal/pull/8739
10796
- name: Sudo chmod to permit ghcup to update its cache
97+
if: runner.os == 'Linux'
10898
run: |
109-
if [[ "${{ runner.os }}" == "Linux" ]]; then
11099
sudo ls -lah /usr/local/.ghcup/cache
111100
sudo mkdir -p /usr/local/.ghcup/cache
112101
sudo ls -lah /usr/local/.ghcup/cache
113-
sudo chown -R $USER /usr/local/.ghcup
102+
sudo chown -R "${USER}" /usr/local/.ghcup
114103
sudo chmod -R 777 /usr/local/.ghcup
115-
fi
116104
- name: ghcup
117105
run: |
118106
ghcup --version
@@ -128,9 +116,6 @@ jobs:
128116
name: Check Release Project
129117
runs-on: ubuntu-latest
130118
steps:
131-
- name: Set PATH
132-
run: |
133-
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
134119
- name: ghcup
135120
run: |
136121
ghcup --version
@@ -144,4 +129,3 @@ jobs:
144129
run: cabal build all --dry-run --project-file=cabal.project.release
145130
- name: Check Release with Latest Hackage
146131
run: cabal build all --dry-run --project-file=cabal.project.release --index-state="hackage.haskell.org HEAD"
147-

0 commit comments

Comments
 (0)