Skip to content

Commit

Permalink
Merge pull request #1 from cspr-rad/add-casper-node
Browse files Browse the repository at this point in the history
Add casper node, casper-client-rs, casper-node-launcher
  • Loading branch information
marijanp authored Jan 22, 2024
2 parents b17c159 + a60a449 commit 23afbbf
Show file tree
Hide file tree
Showing 9 changed files with 4,816 additions and 0 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: check
on:
pull_request:
branches: [main]
push:
branches: [main]

jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
- uses: DeterminateSystems/magic-nix-cache-action@v2

- name: System Info
run: |
uname -a
nix --version
- name: format
if: matrix.os == 'ubuntu-latest'
run: nix build -L --no-link --show-trace .#checks.x86_64-linux.format

- name: casper-node
if: matrix.os == 'ubuntu-latest'
run: nix build -L --no-link --show-trace .#packages.x86_64-linux.casper-node

- name: casper-node
if: matrix.os == 'macos-latest'
run: nix build -L --no-link --show-trace .#packages.x86_64-darwin.casper-node

- name: casper-node-launcher
if: matrix.os == 'ubuntu-latest'
run: nix build -L --no-link --show-trace .#packages.x86_64-linux.casper-node-launcher

- name: casper-node-launcher
if: matrix.os == 'macos-latest'
run: nix build -L --no-link --show-trace .#packages.x86_64-darwin.casper-node-launcher

- name: casper-client-rs
if: matrix.os == 'ubuntu-latest'
run: nix build -L --no-link --show-trace .#packages.x86_64-linux.casper-client-rs

- name: casper-client-rs
if: matrix.os == 'macos-latest'
run: nix build -L --no-link --show-trace .#packages.x86_64-darwin.casper-client-rs
27 changes: 27 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 = "A collection of casper related packages";
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, ... }:
let
eachSystem = systems: f:
let
# Merge together the outputs for all systems.
op = attrs: system:
let
ret = f system;
op = attrs: key: attrs //
{
${key} = (attrs.${key} or { })
// { ${system} = ret.${key}; };
}
;
in
builtins.foldl' op attrs (builtins.attrNames ret);
in
builtins.foldl' op { } systems;

eachDefaultSystem = eachSystem [
"aarch64-darwin"
"x86_64-darwin"
"x86_64-linux"
];
in
eachDefaultSystem (system:
let
pkgs = nixpkgs.legacyPackages.${system};
csprpkgs = pkgs.recurseIntoAttrs (pkgs.callPackage ./pkgs { });
in
{
packages = {
inherit (csprpkgs)
casper-node
casper-node-launcher
casper-client-rs
;
};
formatter = pkgs.nixpkgs-fmt;

checks.format = pkgs.runCommand "format-check" { buildInputs = [ pkgs.nixpkgs-fmt ]; } ''
set -euo pipefail
cd ${self}
nixpkgs-fmt --check .
touch $out
'';
});
}
Loading

0 comments on commit 23afbbf

Please sign in to comment.