Skip to content

Commit

Permalink
chore: Migrate to new spago
Browse files Browse the repository at this point in the history
This replaces `shell.nix` with `flake.nix` so we can use
`purescript-overlay` with the new `spago`. (I'm not sure all this is
needed, just adapting from configuration I've seen for other projects,
like
thomashoneyman/purescript-halogen-realworld#124)

I've run `npx spago-legacy migrate` and manually added the test
dependencies to the new `spago.yaml` file.
  • Loading branch information
pete-murphy committed Mar 23, 2024
1 parent 0142716 commit 1d621fc
Show file tree
Hide file tree
Showing 8 changed files with 4,697 additions and 48 deletions.
27 changes: 20 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,39 @@
name: CI

on:
push:
branches: main
on:
push:
branches: [main]
pull_request:

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- uses: thomashoneyman/setup-purescript@main
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v4

- name: Setup Nix cache
uses: DeterminateSystems/magic-nix-cache-action@v2

- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/*.dhall') }}
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.yaml') }}
path: |
.spago
output
- run: spago build
- name: Load Nix environment
run: nix develop

- name: Build source
run: spago build

- name: Run tests
run: spago test

- run: spago -x test/test.dhall test
- name: Check formatting
run: purs-tidy check src test
121 changes: 121 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 29 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
flake-utils.url = "github:numtide/flake-utils";
purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = {
self,
nixpkgs,
flake-utils,
purescript-overlay,
}:
flake-utils.lib.eachDefaultSystem (system: let
overlays = [purescript-overlay.overlays.default];
pkgs = import nixpkgs {inherit system overlays;};
in {
devShells.default = pkgs.mkShell {
buildInputs = with pkgs; [
purs
purs-tidy
purs-backend-es
spago-unstable
nodejs_20
];
};
});
}
5 changes: 0 additions & 5 deletions packages.dhall

This file was deleted.

23 changes: 0 additions & 23 deletions shell.nix

This file was deleted.

13 changes: 0 additions & 13 deletions spago.dhall

This file was deleted.

Loading

0 comments on commit 1d621fc

Please sign in to comment.