Skip to content

Commit

Permalink
Add simple wrapper for the threading API (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
f-f authored Jul 6, 2024
1 parent bad94dc commit 90a6e7a
Show file tree
Hide file tree
Showing 10 changed files with 1,014 additions and 0 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: CI

on:
push:
branches: [master]
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: actions/setup-node@v1
with:
node-version: "22"

- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v12
- uses: DeterminateSystems/magic-nix-cache-action@main

- name: Setup PureScript dependencies
run: npm i --global [email protected] spago@next purescm@latest

- name: Build source
run: spago build

- name: Cache PureScript dependencies
uses: actions/cache@v2
with:
key: ${{ runner.os }}-spago-${{ hashFiles('**/spago.yaml') }}
path: |
.spago
output
- name: Run tests
run: |
nix-shell --run "purescm run --main Test.Chez.Main"
14 changes: 14 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

bower_components/
node_modules/
.pulp-cache/
output/
output-es/
generated-docs/
.psc-package/
.psc*
.purs*
.psa*
.spago
.envrc
.direnv
104 changes: 104 additions & 0 deletions flake.lock

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

53 changes: 53 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
description = "PureScript core packages CI setup";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs/nixpkgs-unstable";

flake-compat = {
url = "github:edolstra/flake-compat";
flake = false;
};

purescript-overlay.url = "github:thomashoneyman/purescript-overlay";
purescript-overlay.inputs.nixpkgs.follows = "nixpkgs";
};

outputs = { self, nixpkgs, ... }@inputs:
let
supportedSystems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];

forAllSystems = nixpkgs.lib.genAttrs supportedSystems;

nixpkgsFor = forAllSystems (system: import nixpkgs {
inherit system;
overlays = builtins.attrValues self.overlays;
});
in
{
overlays = {
purescript = inputs.purescript-overlay.overlays.default;
};

devShells = forAllSystems (system:
let pkgs = nixpkgsFor.${system};
chez = pkgs.chez.overrideAttrs (final: prev: {
postFixup = if pkgs.stdenv.isDarwin then ''
install_name_tool -add_rpath ${pkgs.pcre2.out}/lib $out/bin/scheme
''
else ''
patchelf $out/bin/scheme --add-rpath ${pkgs.pcre2.out}/lib
'';
});
in {
default = pkgs.mkShell {
name = "purescm";
packages = with pkgs; [
chez
];
};
});

formatter = forAllSystems (system: nixpkgsFor.${system}.nixpkgs-fmt);
};
}
13 changes: 13 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# A compatibility file that allows non-flakes users to still get a development
# shell with `nix-shell`.
(import
(
let lock = builtins.fromJSON (builtins.readFile ./flake.lock);
in fetchTarball {
url =
"https://github.com/edolstra/flake-compat/archive/${lock.nodes.flake-compat.locked.rev}.tar.gz";
sha256 = lock.nodes.flake-compat.locked.narHash;
}
)
{ src = ./.; }).shellNix

Loading

0 comments on commit 90a6e7a

Please sign in to comment.