-
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add setup for a new freeze file without cabal index timestap for use …
…in cache key Use bash (windows) polish
- Loading branch information
Showing
1 changed file
with
34 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,11 +67,44 @@ jobs: | |
run: | | ||
cabal freeze | ||
- name: Setup cabal.project.freeze.cache.key | ||
shell: bash | ||
run: | | ||
# Create a new caba.project.freeze.cache.key file for the cache key, removing the cabal index timestamp in the last line | ||
source_file="cabal.project.freeze" | ||
target_file="cabal.project.freeze.cache.key" | ||
# Check if the source file exists | ||
if [ ! -e "$source_file" ]; then | ||
echo "Source file '$source_file' does not exist." | ||
exit 1 | ||
fi | ||
# Copy the source file to the target file | ||
cp "$source_file" "$target_file" | ||
# Check if the copy was successful | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to copy the source file to the target file." | ||
exit 1 | ||
fi | ||
# Remove the last line from the target file | ||
sed -i'' -e '$d' "$target_file" | ||
# Check if the removal of the last line was successful | ||
if [ $? -ne 0 ]; then | ||
echo "Failed to remove the last line from the target file." | ||
exit 1 | ||
fi | ||
echo "File '$target_file' created with the last line removed." | ||
- uses: actions/[email protected] | ||
name: Cache ~/.cabal/store | ||
with: | ||
path: ${{ steps.setup-haskell-cabal.outputs.cabal-store }} | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze') }} | ||
key: ${{ runner.os }}-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze.cache.key') }} | ||
|
||
- name: Build | ||
run: | | ||
|