Skip to content

Commit

Permalink
Update for spago@next (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
thomashoneyman authored Jan 20, 2024
1 parent 7acf8e3 commit 10fe093
Show file tree
Hide file tree
Showing 10 changed files with 183 additions and 682 deletions.
29 changes: 13 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,42 +10,39 @@ jobs:
runs-on: ubuntu-latest

steps:
# SETUP
- uses: actions/checkout@v2

- uses: thomashoneyman/setup-purescript@main
with:
purescript: "0.15.4"
spago: "0.20.9"
purs-tidy: "0.9.0"
- 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
- uses: actions/setup-node@v2
with:
node-version: "16.x"
cache: "npm"
- name: Load Nix environment
run: nix develop

- name: Install NPM dependencies
run: npm ci
run: nix develop --command npm ci

- name: Build source
run: spago build
run: nix develop --command npm run build

- name: Run tests
run: spago test --no-install
run: nix develop --command npm run test

- name: Check formatting
run: purs-tidy check src test
run: nix develop --command purs-tidy check src test

- name: Run bundle
run: npm run bundle
run: nix develop --command npm run bundle

- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v3
Expand Down
93 changes: 75 additions & 18 deletions flake.lock

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

76 changes: 37 additions & 39 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,50 @@
description = "RealWorld spec in the PureScript Halogen framework";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixos-21.11";
easy-purescript-nix = {
url = "github:justinwoo/easy-purescript-nix";
flake = false;
};
flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};
nixpkgs.url = "github:nixos/nixpkgs/nixos-23.05";
purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
flake-compat.url = "github:edolstra/flake-compat";
flake-compat.flake = false;
};

outputs = { self, nixpkgs, easy-purescript-nix, ... }@inputs:
let
name = "halogen-realworld";
outputs = {
self,
nixpkgs,
purescript-overlay,
...
}: let
name = "halogen-realworld";

supportedSystems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
supportedSystems = [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];

forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
forAllSystems = f: nixpkgs.lib.genAttrs supportedSystems (system: f system);
in {
devShell = forAllSystems (system: let
overlays = [purescript-overlay.overlays.default];
pkgs = import nixpkgs {inherit system overlays;};
in
{
devShell = forAllSystems (system:
let
pkgs = import nixpkgs { inherit system; };

easy-ps = import easy-purescript-nix { inherit pkgs; };
in
pkgs.mkShell {
inherit name;
buildInputs = (with pkgs; [
nodejs-16_x
nixpkgs-fmt
]) ++ (with easy-ps; [
purs
purs-tidy
psa
spago
purescript-language-server
]) ++ (pkgs.lib.optionals (system == "aarch64-darwin")
pkgs.mkShell {
inherit name;
buildInputs =
[
pkgs.esbuild
pkgs.nodejs_20
pkgs.nixpkgs-fmt
pkgs.purs
pkgs.purs-tidy
pkgs.purs-backend-es
pkgs.purescript-language-server
pkgs.spago-unstable
]
++ (pkgs.lib.optionals (system == "aarch64-darwin")
(with pkgs.darwin.apple_sdk.frameworks; [
Cocoa
CoreServices
]));
});
};
});
};
}
Loading

0 comments on commit 10fe093

Please sign in to comment.