Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
guillemcordoba committed Mar 6, 2024
1 parent 0b35f71 commit a39a1e3
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/test-nix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: "test-nix-infra"
on:
# Trigger the workflow on push or pull request,
# but only for the main branch
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]

jobs:
testbuild:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Extend space
uses: ./.github/actions/extend-space

- name: Install nix
uses: cachix/install-nix-action@v18
with:
install_url: https://releases.nixos.org/nix/nix-2.12.0/install
extra_nix_config: |
experimental-features = flakes nix-command
- uses: cachix/cachix-action@v10
with:
name: holochain-ci

- name: Install coreutils for macOS
if: matrix.os == 'macos-latest'
run: brew install coreutils

- name: Build zomes
run: |
cd ./nix/fixture
nix build -L .#my_zome.meta.debug
sha256sum result
nix build -L .#my_zome
sha256sum result
2 changes: 1 addition & 1 deletion flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
overlays = [ (import inputs.rust-overlay) ];
};

rustToolchain = pkgs.rust-bin.stable."1.74.1".minimal.override {
rustToolchain = pkgs.rust-bin.nightly."2024-01-29".minimal.override {
# Set the build targets supported by the toolchain,
# wasm32-unknown-unknown is required for trunk.
targets = [ "wasm32-unknown-unknown" ];
Expand Down
6 changes: 3 additions & 3 deletions nix/fixture/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# cargo-features = ["trim-paths"]
cargo-features = ["trim-paths"]

[workspace]
members = ["zome"]
Expand All @@ -12,5 +12,5 @@ serde = "1"

[profile.release]
opt-level = "z"
# trim-paths = true
# remap-debuginfo = true
trim-paths = true
remap-debuginfo = true
2 changes: 1 addition & 1 deletion nix/fixture/flake.lock

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

1 change: 1 addition & 0 deletions nix/fixture/zome/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use hdk::prelude::*;


#[hdk_extern]
pub fn hello(_: ()) -> ExternResult<String> {
Ok(String::from("hello"))
Expand Down
4 changes: 2 additions & 2 deletions nix/zome.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
}:

let
cargoExtraArgs = "--workspace ${if excludedCrates != null then builtins.concatStringsSep " " (builtins.map (excludedCrate: ''--exclude ${excludedCrate}'') excludedCrates) else ''''}";
cargoExtraArgs = "-Z avoid-dev-deps --workspace ${if excludedCrates != null then builtins.concatStringsSep " " (builtins.map (excludedCrate: ''--exclude ${excludedCrate}'') excludedCrates) else ''''}";

cargoToml = builtins.fromTOML (builtins.readFile crateCargoToml);
crate = cargoToml.package.name;
Expand All @@ -31,7 +31,7 @@ let
cargoToml = crateCargoToml;
cargoLock = workspacePath + /Cargo.lock;
cargoArtifacts = wasmDeps;
cargoExtraArgs = "-p ${crate} --locked";
cargoExtraArgs = "-p ${crate} --locked -v";
pname = crate;
version = cargoToml.package.version;
});
Expand Down

0 comments on commit a39a1e3

Please sign in to comment.