1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Make execution of tests in Nix builds optional (#873)

This commit is contained in:
neodix42 2024-01-24 09:09:10 +01:00 committed by GitHub
parent 2e231ec2ff
commit 9f1b370f2c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 69 additions and 19 deletions

View file

@ -3,12 +3,27 @@
nix-build --version
test $? -eq 0 || { echo "Nix is not installed!"; exit 1; }
with_tests=false
while getopts 't' flag; do
case "${flag}" in
t) with_tests=true ;;
*) break
;;
esac
done
cp assembly/nix/linux-arm64* .
cp assembly/nix/microhttpd.nix .
cp assembly/nix/openssl.nix .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
nix-build linux-arm64-static.nix
if [ "$with_tests" = true ]; then
nix-build linux-arm64-static.nix --arg testing true
else
nix-build linux-arm64-static.nix
fi
mkdir artifacts
cp ./result/bin/* artifacts/
chmod +x artifacts/*
@ -17,4 +32,4 @@ nix-build linux-arm64-tonlib.nix
cp ./result/lib/libtonlibjson.so.0.5 artifacts/libtonlibjson.so
cp ./result/lib/libemulator.so artifacts/
cp -r crypto/fift/lib artifacts/
cp -r crypto/smartcont artifacts/
cp -r crypto/smartcont artifacts/

View file

@ -3,12 +3,28 @@
nix-build --version
test $? -eq 0 || { echo "Nix is not installed!"; exit 1; }
with_tests=false
while getopts 't' flag; do
case "${flag}" in
t) with_tests=true ;;
*) break
;;
esac
done
cp assembly/nix/linux-x86-64* .
cp assembly/nix/microhttpd.nix .
cp assembly/nix/openssl.nix .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
nix-build linux-x86-64-static.nix
if [ "$with_tests" = true ]; then
nix-build linux-x86-64-static.nix --arg testing true
else
nix-build linux-x86-64-static.nix
fi
mkdir artifacts
cp ./result/bin/* artifacts/
chmod +x artifacts/*
@ -17,4 +33,4 @@ nix-build linux-x86-64-tonlib.nix
cp ./result/lib/libtonlibjson.so.0.5 artifacts/libtonlibjson.so
cp ./result/lib/libemulator.so artifacts/
cp -r crypto/fift/lib artifacts/
cp -r crypto/smartcont artifacts/
cp -r crypto/smartcont artifacts/

View file

@ -3,9 +3,25 @@
nix-build --version
test $? -eq 0 || { echo "Nix is not installed!"; exit 1; }
with_tests=false
while getopts 't' flag; do
case "${flag}" in
t) with_tests=true ;;
*) break
;;
esac
done
cp assembly/nix/macos-* .
export NIX_PATH=nixpkgs=https://github.com/nixOS/nixpkgs/archive/23.05.tar.gz
nix-build macos-static.nix
if [ "$with_tests" = true ]; then
nix-build macos-static.nix --arg testing true
else
nix-build macos-static.nix
fi
mkdir artifacts
cp ./result-bin/bin/* artifacts/
chmod +x artifacts/*
@ -14,4 +30,4 @@ nix-build macos-tonlib.nix
cp ./result/lib/libtonlibjson.dylib artifacts/
cp ./result/lib/libemulator.dylib artifacts/
cp -r crypto/fift/lib artifacts/
cp -r crypto/smartcont artifacts/
cp -r crypto/smartcont artifacts/

View file

@ -3,6 +3,7 @@
{ pkgs ? import <nixpkgs> { system = builtins.currentSystem; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, testing ? false
}:
let
microhttpdmy = (import ./microhttpd.nix) {};
@ -25,7 +26,7 @@ stdenv.mkDerivation {
];
makeStatic = true;
doCheck = true;
doCheck = testing;
cmakeFlags = [
"-DTON_USE_ABSEIL=OFF"

View file

@ -3,6 +3,7 @@
{ pkgs ? import <nixpkgs> { system = builtins.currentSystem; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, testing ? false
}:
let
microhttpdmy = (import ./microhttpd.nix) {};
@ -25,7 +26,7 @@ stdenv.mkDerivation {
];
makeStatic = true;
doCheck = true;
doCheck = testing;
cmakeFlags = [
"-DTON_USE_ABSEIL=OFF"

View file

@ -3,6 +3,7 @@
{ pkgs ? import <nixpkgs> { system = builtins.currentSystem; }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, testing ? false
}:
pkgs.llvmPackages_14.stdenv.mkDerivation {
@ -29,7 +30,7 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {
dontAddStaticConfigureFlags = true;
makeStatic = true;
doCheck = true;
doCheck = testing;
configureFlags = [];
@ -62,4 +63,4 @@ pkgs.llvmPackages_14.stdenv.mkDerivation {
done
'';
outputs = [ "bin" "out" ];
}
}