Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable multiple cores in haskell GHA #1006

Merged
merged 1 commit into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
# this should be a no-op, but if the cache key was not found we need to build stuff so we can
# cache it for the next step.
- name: Install dependencies
run: cabal build all --enable-tests --only-dependencies -j --ghc-option=-j4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is the number in the cabal flag not specified but it is in the --ghc-option? I don't know how many cpus in the GHA runner, but I imagine it is a reasonable setting anyway

Copy link
Contributor Author

@carbolymer carbolymer Jan 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Github runners have 4 cores. I have no idea why it was not specified for cabal.
I vaguely remember we had issues when building too many packages concurrently, but I can't reproduce it anymore and -j4 was already maximum parallelism in GHA so it's kind of redundant.

run: cabal build all --enable-tests --only-dependencies

# Always store the cabal cache.
# This can fail (benign failure) if there is already a hash at that key.
Expand Down Expand Up @@ -142,7 +142,7 @@ jobs:
TMP: ${{ runner.temp }}
KEEP_WORKSPACE: 1
CREATE_GOLDEN_FILES: 1
run: cabal test all --enable-tests --test-show-details=direct -j1
run: cabal test all --enable-tests --test-show-details=direct

# We want this check to run first because $(git ls-files -m) (see below) returns both
# modified files *and* deleted files. So we want to fail on deleted files first.
Expand Down
5 changes: 4 additions & 1 deletion cabal.project
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,12 @@ package formatting
flags: +no-double-conversion

tests: True

test-show-details: direct

-- enable parallel builds
jobs: $ncpus
semaphore: True

-- Always write GHC env files, because they are needed for ghci.
write-ghc-environment-files: always

Expand Down
Loading