Skip to content

Commit 186d93d

Browse files
committed
Copy alt project file unconditionally
1 parent 8cd5e7f commit 186d93d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

.github/actions/setup-build/action.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,21 @@ runs:
3232
echo "CABAL_PKGS_DIR=~/.cabal/packages" >> $GITHUB_ENV
3333
shell: bash
3434

35+
# This copy an alternative cabal-ghc${GHCVER}.project (for example cabal-ghc921.project)
36+
# as main cabal-project, for not fully supported ghc versions
3537
# Needs to be before the caching step so that the cache can detect changes to the modified cabal.project file
36-
- if: inputs.ghc == '9.0.1' || inputs.ghc == '9.2.1'
37-
name: (GHC 9.0/9.2) Use modified `cabal.project`
38+
- name: Use possible modified `cabal.project`
3839
env:
3940
GHCVER: ${{ inputs.ghc }}
4041
run: |
4142
# File has some protections preventing regular `rm`.
4243
# (most probably sticky bit is set on $HOME)
4344
# `&&` insures `rm -f` return is positive.
4445
# Many platforms aslo have `alias cp='cp -i'`.
45-
rm -f -v cabal.project && cp -v cabal-ghc${GHCVER//./}.project cabal.project
46+
ALT_PROJECT_FILE=cabal-ghc${GHCVER//./}.project
47+
if [[ -f "$ALT_PROJECT_FILE" ]]; then
48+
rm -f -v cabal.project && cp -v "$ALT_PROJECT_FILE" cabal.project
49+
fi
4650
shell: bash
4751

4852
- if: inputs.os == 'Windows' && inputs.ghc == '8.8.4'

0 commit comments

Comments
 (0)