1- name : Assorted
1+ name : Changelogs
22
33on :
44 push :
@@ -25,43 +25,48 @@ jobs:
2525 runs-on : ubuntu-latest
2626
2727 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
5230 # https://github.com/haskell/cabal/issues/7360
31+ # Also, we would like to get the build plan for the cache key.
5332 - name : Fetch changelog-d
5433 run : |
5534 changelog_d_latest="$(curl https://codeberg.org/api/v1/repos/fgaz/changelog-d/branches/master | jq -r .commit.id)"
5635 echo "Using changelog-d revision $changelog_d_latest"
5736 curl "https://codeberg.org/fgaz/changelog-d/archive/$changelog_d_latest.tar.gz" -o changelog-d.tar.gz
5837 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+
5955 - name : Install changelog-d
56+ working-directory : changelog-d
6057 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+
6570 - name : Run changelog-d
6671 run : |
6772 changelog-d changelog.d
0 commit comments