-
Notifications
You must be signed in to change notification settings - Fork 17
chore: Replace haskell.nix
with stacklock2nix
#251
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
Merged
Merged
Changes from 35 commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
cc1f30a
PoC: Replace haskell.nix with stacklock2nix
sestrella f1c8585
Build hapistrano in Linux
fm7-1 c097625
Upgrade stack.yaml
sestrella fe6482c
Add missing all-cabal-hashes
sestrella 2cb8394
Fix package boundaries warnings
sestrella 949f07f
Disable tests for hapistrano package
sestrella 0054b44
Override testToolDepends for hapistrano
sestrella 8b064d2
Support all nix default systems
sestrella 3db5094
Add overlay
sestrella ae95d76
Add devenv example
sestrella ea1888f
Remove flake-utils
sestrella 27116be
Refactor forAllSystems
sestrella ac44f4d
Conditional sha256 based on platform
sestrella e92b432
Extract overlay to a separate file
sestrella b399411
Building on the CI
sestrella c4312c6
Setup binary cache
sestrella f9e8904
Remove `allow-newer` flag from `stack.yaml`
sestrella a326ae1
Add non-Nix build
sestrella 2ab375b
Install devenv
sestrella cf2e995
Shorten feedback loop for build job
sestrella faf199a
Install GHC via Nix
sestrella f1238ea
Try macos-latest runner
sestrella 9fbc637
Cache dependencies
sestrella 0811fac
Compile and run tests
sestrella e095cb0
Enable ubuntu-latest runner
sestrella 7ecb77f
Install gmp for Linux
sestrella cf528f8
Set locale
sestrella abc8f34
Add missing descriptions to jobs' steps
sestrella d1f71d3
Remove `devenv` example
sestrella 4651882
Add comments about keeping GHC version in sync
sestrella b0f77f1
Enable docker job / Remove bin folder
sestrella c2276d8
Update NIX documentation via claude
sestrella 179ebdd
Update lock files
sestrella 5b39e5c
Revert "Update lock files"
sestrella 0fb41a1
Remove duplicated entries from `.gitignore`
sestrella abcc21d
Add aarch64-linux and x86_64-darwin runners
sestrella 3fb96c8
Remove macos-13 and ubuntu-24.04-arm runners to reduce storage usage …
sestrella 9a9521a
Print warning for untested systems
sestrella f48c3e8
Revert changes made to package constraints lower bound to avoid break…
sestrella File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
---|---|---|
@@ -1 +1,5 @@ | ||
use flake | ||
export DIRENV_WARN_TIMEOUT=20s | ||
|
||
eval "$(devenv direnvrc)" | ||
|
||
use devenv |
This file contains hidden or 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 |
---|---|---|
|
@@ -9,31 +9,76 @@ on: | |
types: | ||
- opened | ||
- synchronize | ||
|
||
concurrency: | ||
group: build-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
haskell: | ||
build: | ||
strategy: | ||
matrix: | ||
runner: | ||
- macos-latest | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.runner }} | ||
env: | ||
LANG: en_US.UTF-8 | ||
LC_ALL: en_US.UTF-8 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v31 | ||
- name: Setup Cachix | ||
uses: cachix/cachix-action@v16 | ||
with: | ||
name: devenv | ||
- name: Install devenv | ||
run: nix profile install nixpkgs#devenv | ||
- name: Setup cache for `~/.stack` | ||
uses: actions/cache@v4 | ||
with: | ||
path: ~/.stack | ||
key: ${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}-${{ hashFiles('hapistrano.cabal') }} | ||
restore-keys: | | ||
${{ runner.os }}-stack-global-${{ hashFiles('stack.yaml') }}- | ||
${{ runner.os }}-stack-global- | ||
- name: Install dependencies | ||
run: devenv shell -- stack build --only-dependencies --test | ||
DavidMazarro marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- name: Setup cache for `.stack-work` | ||
uses: actions/cache@v4 | ||
with: | ||
path: .stack-work | ||
key: ${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('hapistrano.cabal') }}-${{ hashFiles('**/*.hs') }} | ||
restore-keys: | | ||
${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}-${{ hashFiles('hapistrano.cabal') }}- | ||
${{ runner.os }}-stack-work-${{ hashFiles('stack.yaml') }}- | ||
${{ runner.os }}-stack-work- | ||
- name: Compile code | ||
run: devenv shell -- stack build --test --no-run-tests | ||
- name: Run tests | ||
run: devenv shell -- stack test | ||
|
||
nix-build: | ||
strategy: | ||
matrix: | ||
os: | ||
- macos-13 # x86_64-darwin | ||
- macos-latest # aarch64-darwin | ||
- ubuntu-latest # x86_64-linux | ||
fail-fast: true | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 30 | ||
runner: | ||
- macos-latest | ||
- ubuntu-latest | ||
runs-on: ${{ matrix.runner }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: DeterminateSystems/nix-installer-action@v12 | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Nix | ||
uses: cachix/install-nix-action@v31 | ||
- name: Setup Cachix | ||
uses: cachix/cachix-action@v16 | ||
Comment on lines
+75
to
+76
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💯 |
||
with: | ||
extra-conf: accept-flake-config = true | ||
- uses: DeterminateSystems/magic-nix-cache-action@v7 | ||
- name: Compile code ${{ matrix.ghc }} | ||
run: nix build .#test | ||
- name: Run tests ${{ matrix.ghc }} | ||
run: nix run .#test | ||
name: stackbuilders | ||
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | ||
- name: Build `default` package | ||
run: nix build | ||
|
||
docker: | ||
uses: ./.github/workflows/reusable-docker.yml | ||
|
This file contains hidden or 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or 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
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ pkgs, lib, ... }: | ||
|
||
{ | ||
packages = | ||
[ | ||
pkgs.git | ||
pkgs.stack | ||
pkgs.zsh | ||
] | ||
++ lib.optionals pkgs.stdenv.isLinux [ | ||
pkgs.gmp | ||
]; | ||
} |
This file contains hidden or 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# yaml-language-server: $schema=https://devenv.sh/devenv.schema.json | ||
inputs: | ||
nixpkgs: | ||
url: github:cachix/devenv-nixpkgs/rolling |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.