Skip to content

Commit

Permalink
Fix #6469 Update GitHub workflow actions
Browse files Browse the repository at this point in the history
Also makes other minor updates to the actions.

Also applies HLint 3.8 suggestions to the code.
  • Loading branch information
mpilgrem committed Feb 1, 2024
1 parent 9c5fb9f commit 69f4289
Show file tree
Hide file tree
Showing 10 changed files with 32 additions and 32 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# As of 16 December 2023, ubuntu-latest, windows-latest and macos-latest come
# As of 1 February 2024, ubuntu-latest, windows-latest and macos-latest come
# with Stack 2.13.1 and GHC 9.8.1. windows-latest comes with NSIS 3.08, for
# which the default value of the 'Unicode' installer attribute is 'true'.
# However, that is not the 'large strings' build of NSIS and creates installers
Expand All @@ -42,16 +42,16 @@ jobs:
cache-bust: "2024-01-20"
steps:
- name: Clone project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache dependencies on Unix-like OS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.cache-bust }}
- name: Cache dependencies on Windows
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~\AppData\Roaming\stack
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
stack etc/scripts/release.hs build ${{ matrix.release-args }}
- name: Upload bindist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ runner.os }}
path: _release/stack-*
Expand Down Expand Up @@ -186,7 +186,7 @@ jobs:
echo '::notice title=ARM64 skipped::To build ARM64, a self-hosted runner needs to be configured and the SELF_HOSTED_RUNNERS secret must contain arm64'
- name: Clone project
if: needs.configuration.outputs.test-arm64 == 'true'
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Install deps
shell: bash
run: |
Expand Down Expand Up @@ -217,7 +217,7 @@ jobs:
- name: Upload bindist
if: needs.configuration.outputs.test-arm64 == 'true'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Linux-ARM64
path: _release/stack-*
Expand All @@ -234,23 +234,23 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')
steps:
- name: Download Linux artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Linux
path: _release
- name: Download macOS artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: macOS
path: _release
- name: Download Windows artifact
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Windows
path: _release
- name: Download Linux-ARM64 artifact
if: needs.configuration.outputs.test-arm64 == 'true'
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: Linux-ARM64
path: _release
Expand All @@ -270,7 +270,7 @@ jobs:
- name: Create GitHub release (final)
id: github_release_final
if: "!startsWith(github.ref, 'refs/tags/rc/')"
uses: ncipollo/release-action@v1.10.0
uses: ncipollo/release-action@v1.13.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand All @@ -289,7 +289,7 @@ jobs:
- name: Create GitHub release (release candidate)
id: github_release_rc
if: "startsWith(github.ref, 'refs/tags/rc/')"
uses: ncipollo/release-action@v1.10.0
uses: ncipollo/release-action@v1.13.0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Apply yamllint
uses: ibiqlik/action-yamllint@v3
with:
format: github
- name: Set up HLint
uses: haskell/actions/hlint-setup@v2
uses: haskell-actions/hlint-setup@v2
with:
version: "3.6.1"
version: "3.8"
- name: Apply HLint
run: |
set -ex
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/stan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ jobs:

steps:
- name: Clone project
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
Expand All @@ -23,7 +23,7 @@ jobs:
run: |
git clone https://github.com/kowainik/stan.git
cd stan
stack --compiler ghc-9.6.4 --local-bin-path ../.bin install
stack --local-bin-path ../.bin install
cd ..
- name: Generate .hie for analysis
Expand All @@ -33,7 +33,7 @@ jobs:
run: .bin/stan report --cabal-file-path=stack.cabal

- name: Upload HTML report
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: Stan_report
path: stan.html
12 changes: 6 additions & 6 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
- rc/**
workflow_dispatch:

# As of 16 December 2023, ubuntu-latest, windows-latest and macos-latest come
# As of 1 February 2024, ubuntu-latest, windows-latest and macos-latest come
# with Stack 2.13.1 and GHC 9.8.1.

jobs:
Expand All @@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Clone project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache dependencies
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}
Expand Down Expand Up @@ -53,16 +53,16 @@ jobs:
stack-args: ""
steps:
- name: Clone project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Cache dependencies on Unix-like OS
if: startsWith(runner.os, 'Linux') || startsWith(runner.os, 'macOS')
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.stack
key: ${{ runner.os }}-${{ hashFiles('stack.yaml') }}-${{ matrix.extra-suffix }}
- name: Cache dependencies on Windows
if: startsWith(runner.os, 'Windows')
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: |
~\AppData\Roaming\stack
Expand Down
2 changes: 1 addition & 1 deletion .hlint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
- DuplicateRecordFields
- NoFieldSelectors
- OverloadedLists
# Provided from GHC 9.2.1 (base-4.16.0.0):
# Provided from GHC 9.2.1 (base-4.16.0.0):
- OverloadedRecordDot
- OverloadedStrings
- QuasiQuotes
Expand Down
2 changes: 1 addition & 1 deletion .hlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
- MultiWayIf
- NoFieldSelectors
- OverloadedLists
# Provided from GHC 9.2.1 (base-4.16.0.0):
# Provided from GHC 9.2.1 (base-4.16.0.0):
- OverloadedRecordDot
- OverloadedStrings
- QuasiQuotes
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Coverage.hs
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ generateHpcMarkupIndex = do
let outputFile = outputDir </> relFileIndexHtml
ensureDir outputDir
(dirs, _) <- listDir outputDir
rows <- fmap (catMaybes . concat) $ forM dirs $ \dir -> do
rows <- fmap (concatMap catMaybes) $ forM dirs $ \dir -> do
(subdirs, _) <- listDir dir
forM subdirs $ \subdir -> do
let indexPath = subdir </> relFileHpcIndexHtml
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Ghci.hs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ writeMacrosFile ::
-> [GhciPkgInfo]
-> RIO env [String]
writeMacrosFile outputDirectory pkgs = do
fps <- fmap (nubOrd . catMaybes . concat) $
fps <- fmap (nubOrd . concatMap catMaybes) $
forM pkgs $ \pkg -> forM pkg.opts $ \(_, bio) -> do
let cabalMacros = bio.cabalMacros
exists <- liftIO $ doesFileExist cabalMacros
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/PackageFile.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ resolveGlobFiles ::
-> [String]
-> RIO GetPackageFileContext (Set (Path Abs File))
resolveGlobFiles cabalFileVersion =
fmap (S.fromList . catMaybes . concat) . mapM resolve
fmap (S.fromList . concatMap catMaybes) . mapM resolve
where
resolve name =
if '*' `elem` name
Expand Down
2 changes: 1 addition & 1 deletion src/Stack/Runners.hs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ shouldUpgradeCheck = do
config <- ask
when config.recommendUpgrade $ do
now <- getCurrentTime
let yesterday = addUTCTime (-24 * 60 * 60) now
let yesterday = addUTCTime (-(24 * 60 * 60)) now
checks <- upgradeChecksSince yesterday
when (checks == 0) $ do
mversion <- getLatestHackageVersion NoRequireHackageIndex "stack" UsePreferredVersions
Expand Down

0 comments on commit 69f4289

Please sign in to comment.