File tree Expand file tree Collapse file tree 3 files changed +45
-14
lines changed Expand file tree Collapse file tree 3 files changed +45
-14
lines changed Original file line number Diff line number Diff line change 4040 - name : Test Anchor CLI
4141 run : |
4242 nix run .#anchor-cli -- --version
43+
44+ - name : Test Anchor Program
45+ run : |
46+ nix build .#anchor-test -L --impure --option sandbox false
Original file line number Diff line number Diff line change 11{
22 stdenv ,
33 anchor-cli ,
4+ solana-cli ,
5+ solana-rust ,
46 runCommand ,
7+ nodejs ,
8+ yarn ,
9+ cacert
510} :
611let
7- src = runCommand "anchor-test-src"
8- {
9- nativeBuildInputs = [ anchor-cli ] ;
10- }
11- ''
12- mkdir -p $out
13- cd $out
14- anchor init example -j --no-install --no-git --test-template rust
15- mv example/.* example/* .
16- rm -rf example
17- '' ;
12+ src =
13+ runCommand "anchor-test-src"
14+ {
15+ nativeBuildInputs = [
16+ anchor-cli
17+ nodejs
18+ yarn
19+ ] ;
20+ }
21+ ''
22+ mkdir -p $out
23+ cd $out
24+ export HOME=$(mktemp -d)
25+ RUST_LOG=trace anchor init example --javascript --no-install --no-git --package-manager yarn
26+ mv example/.* example/* .
27+ rm -rf example
28+ '' ;
1829in
1930stdenv . mkDerivation {
31+ # Disable sandboxing
32+ # this is for CI live test check and we want to make sure
33+ # anchor init and build work when ran by a user
34+ __noChroot = true ;
2035 pname = "anchor-test" ;
2136 inherit src ;
2237 version = "1.0.0" ;
2338
2439 doCheck = false ;
2540
26- nativeBuildInputs = [ anchor-cli ] ;
41+ nativeBuildInputs = [
42+ anchor-cli
43+ solana-cli
44+ nodejs
45+ yarn
46+ solana-rust
47+ cacert
48+ ] ;
2749
2850 buildPhase = ''
51+ export HOME=$(mktemp -d)
52+ yarn install
53+ solana-keygen new --no-bip39-passphrase
2954 anchor build
3055 anchor test
3156 '' ;
57+
58+ # Write an output so its cached
3259 installPhase = ''
3360 echo ok > $out
3461 '' ;
3562
3663 meta = {
37- description = "Anchor build testing" ;
64+ description = "Anchor build testing of a new project initialised " ;
3865 } ;
3966}
Original file line number Diff line number Diff line change 5454 crane = crane . mkLib pkgs ;
5555 } ;
5656 anchor-test = pkgs . callPackage ./anchor-test.nix {
57- inherit anchor-cli ;
57+ inherit anchor-cli solana-cli solana-rust ;
5858 } ;
5959 in
6060 {
You can’t perform that action at this time.
0 commit comments