Skip to content

Commit

Permalink
Run tests on CI
Browse files Browse the repository at this point in the history
  • Loading branch information
visortelle committed Apr 24, 2024
1 parent 4f5ec84 commit 12eba28
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 7 deletions.
6 changes: 2 additions & 4 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
indent_style = space
indent_size = 4
indent_size = 2

[*.rs]
max_line_length = 100
indent_size = 4

[*.md]
# double whitespace at end of line
# denotes a line break in Markdown
trim_trailing_whitespace = false

[*.yml]
indent_size = 2

[Makefile]
indent_style = tab
28 changes: 28 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
on:
push

jobs:
build:
strategy:
matrix:
include:
- runner: x64
arch: x64

runs-on: [self-hosted, "${{ matrix.runner }}"]

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-unstable
install_options: --no-daemon
extra_nix_config: experimental-features = nix-command flakes

- name: Test
shell: bash
run: nix-shell --run 'make test'
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name = "puls"
version = "0.1.0"
edition = "2021"

[profile.release]
strip = true
opt-level = "z"
lto = true
codegen-units = 1

[dependencies]
anyhow = "1.0.82"
assert_cmd = { version = "2.0.14", features = ["color", "color-auto"] }
Expand Down
8 changes: 5 additions & 3 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@
config.allowBroken = true;
};

protoc-gen-grpc-web = pkgs.callPackage ./nix/protoc-gen-grpc-web.nix { };
protoc-gen-scala = pkgs.callPackage ./nix/protoc-gen-scala.nix { };
apache-pulsar = pkgs.callPackage ./nix/apache-pulsar.nix { };

missingSysPkgs =
if pkgs.stdenv.isDarwin then
Expand All @@ -52,17 +51,20 @@

puls-dev = pkgs.mkShell {
shellHook = ''
export JAVA_HOME=$(echo "$(which java)" | sed 's/\/bin\/java//g' )
export LD_LIBRARY_PATH="${runtimeLibraryPath}"
'';

packages = [
pkgs.gnumake
pkgs.coreutils
pkgs.git

pkgs.rustup
pkgs.rustfmt
pkgs.cargo-cross

pkgs.git
apache-pulsar
] ++ missingSysPkgs;
};
in
Expand Down
29 changes: 29 additions & 0 deletions nix/apache-pulsar.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{ lib, stdenv, fetchzip }:

let
src_any_platform = {
url = "https://www.apache.org/dyn/closer.lua/pulsar/pulsar-3.2.2/apache-pulsar-3.2.2-bin.tar.gz?action=download";
sha512 = "sha512-T5WTyYqSOp32rNBgEPFDGKbAodige+qnNuDI6KpyHDqS2E3J25gLLEpzNLbhcoxBefp4uT2v3DLyUbSC+ApfcQ==";
};
in

stdenv.mkDerivation rec {
pname = "apache-pulsar";
version = "v0.1.0";

src = fetchzip (src_any_platform);

installPhase = ''
mkdir -p "$out"
cp -r $src/* $out
'';

outputs = [ "out" ];

meta = with lib; {
homepage = "https://github.com/apache/pulsar";
description = "Next-gen data streaming platform";
license = licenses.asl20;
platforms = platforms.unix;
};
}

0 comments on commit 12eba28

Please sign in to comment.