Skip to content

Commit

Permalink
Add CI
Browse files Browse the repository at this point in the history
  • Loading branch information
BriungRi committed Feb 14, 2024
1 parent c6a9347 commit 9250dbd
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @blakezimmerman @0xZihan @BriungRi @0xaptosj @banool
21 changes: 21 additions & 0 deletions .github/workflows/move_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: "Move Tests"
on:
pull_request:
push:
branches:
- main

jobs:
move-tests:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./move
steps:
- uses: actions/checkout@v3
- name: Install Nix
uses: cachix/install-nix-action@v17
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Runs move tests.
run: nix-shell --command 'aptos move test --dev'
37 changes: 37 additions & 0 deletions aptos.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{ stdenv, fetchurl, lib, unzip }:

let
os =
if stdenv.isDarwin then "MacOSX"
else if stdenv.isLinux then "Ubuntu"
else throw "Unsupported platform ${stdenv.system}";

sha256 = if os == "MacOSX" then "sha256-6uVxfgcFgxgwF9vwQwaTt23IbV5vNACmjN9BO6TSQ20="
else "sha256-m5wcgXLqoONKiI+7pbwCVhnsKmvjZVS/f1S9sOascF8=";

in stdenv.mkDerivation rec {
pname = "aptos-cli";
version = "2.1.1";

src = fetchurl {
url = "https://github.com/aptos-labs/aptos-core/releases/download/${pname}-v${version}/${pname}-${version}-${os}-x86_64.zip";
sha256 = sha256;
};

buildInputs = [ unzip ];

unpackPhase = ''
unzip $src
'';

installPhase = ''
mkdir -p $out/bin
cp aptos $out/bin/aptos
'';

meta = with lib; {
description = "Aptos CLI";
homepage = "https://github.com/aptos-labs/aptos-core";
platforms = [ "x86_64-darwin" "aarch64-darwin" "x86_64-linux" "aarch64-linux" ];
};
}
30 changes: 30 additions & 0 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
with import <nixpkgs> { };

pkgs.mkShell {
buildInputs = [
jq
nodePackages.nodemon
nodejs_18
(callPackage ./aptos.nix { })
];

shellHook = ''
alias gen="aptos init"
test() {
nodemon \
--ignore build/* \
--ext move \
--exec aptos move test \
--dev
--skip-fetch-latest-git-deps
}
pub() {
local token-minter=0x$(aptos config show-profiles | jq -r '.Result.default.account')
aptos move publish \
--named-addresses token-minter=$token-minter \
--skip-fetch-latest-git-deps
}
'';
}

0 comments on commit 9250dbd

Please sign in to comment.