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

Add simple wrapper for the threading API #1

Merged
merged 7 commits into from
Jul 6, 2024
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
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
Loading