Fix issue/PR templates (#9117)
[cabal.git] / .github / workflows / changelogs.yml
blob425e5117188e50f030b9354efe22ac04ccb270ba
1 name: Assorted
3 on:
4   push:
5     branches:
6     - master
7     paths:
8     - 'changelog.d/*'
9     - '.github/workflows/changelogs.yml'
10   pull_request:
11     paths:
12     - 'changelog.d/*'
13     - '.github/workflows/changelogs.yml'
14   release:
15     types:
16       - created
18 defaults:
19   run:
20     shell: bash
22 jobs:
23   build:
24     name: Changelogs
25     runs-on: ubuntu-latest
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 from tarball due to
52       # https://github.com/haskell/cabal/issues/7360
53       - uses: actions/checkout@v3
54         with:
55           repository: "fgaz/changelog-d"
56           path: "changelog-d"
57       - name: Install changelog-d
58         run: |
59           pushd changelog-d
60           cabal v2-install
61           popd
62       - uses: actions/checkout@v3
63       - name: Run changelog-d
64         run: |
65           changelog-d changelog.d