1
- name : Assorted
1
+ name : Changelogs
2
2
3
3
on :
4
4
push :
@@ -25,43 +25,48 @@ jobs:
25
25
runs-on : ubuntu-latest
26
26
27
27
steps :
28
- - name : Set PATH
29
- # https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
30
- run : |
31
- echo "$HOME/.cabal/bin" >> $GITHUB_PATH
32
- - uses : actions/cache@v3
33
- with :
34
- path : ~/.cabal/store
35
- key : linux-store-changelogs
36
- # See https://github.com/haskell/cabal/pull/8739
37
- - name : Sudo chmod to permit ghcup to update its cache
38
- run : |
39
- if [[ "${{ runner.os }}" == "Linux" ]]; then
40
- sudo mkdir -p /usr/local/.ghcup/cache
41
- sudo chown -R $USER /usr/local/.ghcup
42
- sudo chmod -R 777 /usr/local/.ghcup
43
- fi
44
- - name : ghcup
45
- run : |
46
- ghcup config set cache true
47
- ghcup install ghc recommended
48
- ghcup set ghc recommended
49
- - name : Update Hackage index
50
- run : cabal v2-update
51
- # Cannot install it directly from remote tarball due to
28
+
29
+ # Cannot install changelog-d directly from remote tarball due to
52
30
# https://github.com/haskell/cabal/issues/7360
31
+ # Also, we would like to get the build plan for the cache key.
53
32
- name : Fetch changelog-d
54
33
run : |
55
34
changelog_d_latest="$(curl https://codeberg.org/api/v1/repos/fgaz/changelog-d/branches/master | jq -r .commit.id)"
56
35
echo "Using changelog-d revision $changelog_d_latest"
57
36
curl "https://codeberg.org/fgaz/changelog-d/archive/$changelog_d_latest.tar.gz" -o changelog-d.tar.gz
58
37
tar -xf changelog-d.tar.gz
38
+
39
+ - name : Update Hackage index
40
+ run : cabal v2-update
41
+
42
+ - name : Build plan for changelog-d
43
+ working-directory : changelog-d
44
+ run : |
45
+ cabal v2-build --dry-run --allow-newer=changelog-d:base
46
+
47
+ - name : Restore dependencies of changelog-d
48
+ uses : actions/cache/restore@v4
49
+ id : cache
50
+ with :
51
+ path : ~/.local/state/cabal
52
+ key : linux-store-changelogs-${{ hashfiles('changelog-d/dist-newstyle/cache/plan.json') }}
53
+ restore-keys : linux-store-changelogs
54
+
59
55
- name : Install changelog-d
56
+ working-directory : changelog-d
60
57
run : |
61
- pushd changelog-d
62
- cabal v2-install
63
- popd
64
- - uses : actions/checkout@v4
58
+ cabal v2-install --allow-newer=changelog-d:base
59
+
60
+ - name : Cache dependencies of changelog-d
61
+ uses : actions/cache/save@v4
62
+ if : always() && steps.cache.outputs.cache-hit != 'true'
63
+ with :
64
+ path : ~/.local/state/cabal
65
+ key : ${{ steps.cache.outputs.cache-primary-key }}
66
+
67
+ - name : Checkout cabal sources
68
+ uses : actions/checkout@v4
69
+
65
70
- name : Run changelog-d
66
71
run : |
67
72
changelog-d changelog.d
0 commit comments