Skip to content

Commit 2533039

Browse files
andreasabelulysses4ever
authored andcommitted
CI changelogs: switch to XDG, fix cache key
This is the same as #9845 but for the changelogs.yml workflow. `changelog-d` currently has restrictive bound `base < 4.19` which we need to ignore if we want to build on the latest GHC as shipped by the GHA runner. (cherry picked from commit af5d606) # Conflicts: # .github/workflows/changelogs.yml
1 parent edc131f commit 2533039

File tree

1 file changed

+45
-5
lines changed

1 file changed

+45
-5
lines changed

.github/workflows/changelogs.yml

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Assorted
1+
name: Changelogs
22

33
on:
44
push:
@@ -25,6 +25,7 @@ jobs:
2525
runs-on: ubuntu-latest
2626

2727
steps:
28+
<<<<<<< HEAD
2829
- name: Set PATH
2930
# https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#adding-a-system-path
3031
run: |
@@ -55,11 +56,50 @@ jobs:
5556
repository: "fgaz/changelog-d"
5657
path: "changelog-d"
5758
- name: Install changelog-d
59+
=======
60+
61+
# Cannot install changelog-d directly from remote tarball due to
62+
# https://github.com/haskell/cabal/issues/7360
63+
# Also, we would like to get the build plan for the cache key.
64+
- name: Fetch changelog-d
5865
run: |
59-
pushd changelog-d
60-
cabal v2-install
61-
popd
62-
- uses: actions/checkout@v4
66+
changelog_d_latest="$(curl https://codeberg.org/api/v1/repos/fgaz/changelog-d/branches/master | jq -r .commit.id)"
67+
echo "Using changelog-d revision $changelog_d_latest"
68+
curl "https://codeberg.org/fgaz/changelog-d/archive/$changelog_d_latest.tar.gz" -o changelog-d.tar.gz
69+
tar -xf changelog-d.tar.gz
70+
71+
- name: Update Hackage index
72+
run: cabal v2-update
73+
74+
- name: Build plan for changelog-d
75+
working-directory: changelog-d
76+
>>>>>>> af5d60613 (CI changelogs: switch to XDG, fix cache key)
77+
run: |
78+
cabal v2-build --dry-run --allow-newer=changelog-d:base
79+
80+
- name: Restore dependencies of changelog-d
81+
uses: actions/cache/restore@v4
82+
id: cache
83+
with:
84+
path: ~/.local/state/cabal
85+
key: linux-store-changelogs-${{ hashfiles('changelog-d/dist-newstyle/cache/plan.json') }}
86+
restore-keys: linux-store-changelogs
87+
88+
- name: Install changelog-d
89+
working-directory: changelog-d
90+
run: |
91+
cabal v2-install --allow-newer=changelog-d:base
92+
93+
- name: Cache dependencies of changelog-d
94+
uses: actions/cache/save@v4
95+
if: always() && steps.cache.outputs.cache-hit != 'true'
96+
with:
97+
path: ~/.local/state/cabal
98+
key: ${{ steps.cache.outputs.cache-primary-key }}
99+
100+
- name: Checkout cabal sources
101+
uses: actions/checkout@v4
102+
63103
- name: Run changelog-d
64104
run: |
65105
changelog-d changelog.d

0 commit comments

Comments
 (0)