forked from nblockchain/fsx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
.github/workflows: adding sanity check step
- Loading branch information
Showing
6 changed files
with
581 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,3 +13,6 @@ reinstall: | |
|
||
check: | ||
./scripts/runTests.fsx | ||
|
||
sanitycheck: | ||
@./scripts/build.sh sanitycheck |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,9 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
set -exo pipefail | ||
|
||
if [ ! -f ./build.config ]; then | ||
echo "Please run ./configure.sh first" >&2 | ||
exit 1 | ||
BUILD_CONFIG="./build.config" | ||
if [ ! -f "$BUILD_CONFIG" ]; then | ||
echo "ERROR: configure hasn't been run yet, run ./configure.sh first" >&2 && exit 1 | ||
fi | ||
source build.config | ||
|
||
if [[ ! $BuildTool == dotnet* ]]; then | ||
mkdir -p .nuget/ | ||
curl -o .nuget/NuGet.exe https://dist.nuget.org/win-x86-commandline/v5.4.0/nuget.exe | ||
mono .nuget/NuGet.exe restore $Solution | ||
fi | ||
|
||
$BuildTool $Solution $1 | ||
source "$BUILD_CONFIG" | ||
FsxRunnerBin=$FsxRunnerBin FsxRunnerArg=$FsxRunnerArg BuildTool=$BuildTool LegacyBuildTool=$LegacyBuildTool $FsxRunnerBin $FsxRunnerArg ./scripts/make.fsx "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
namespace GWallet.Scripting | ||
|
||
open System | ||
open System.IO | ||
|
||
open Fsdk | ||
open Fsdk.Process | ||
|
||
module FsxHelper = | ||
|
||
let ScriptsDir = __SOURCE_DIRECTORY__ |> DirectoryInfo | ||
let RootDir = Path.Combine(ScriptsDir.FullName, "..") |> DirectoryInfo | ||
let SourceDir = Path.Combine(ScriptsDir.FullName, "../src/") |> DirectoryInfo | ||
let NugetDir = Path.Combine (RootDir.FullName, ".nuget") |> DirectoryInfo | ||
let NugetExe = Path.Combine (NugetDir.FullName, "nuget.exe") |> FileInfo | ||
let NugetSolutionPackagesDir = Path.Combine(RootDir.FullName, "packages") |> DirectoryInfo | ||
let NugetScriptsPackagesDir() = | ||
let dir = Path.Combine(NugetDir.FullName, "packages") |> DirectoryInfo | ||
if not dir.Exists then | ||
Directory.CreateDirectory dir.FullName | ||
|> ignore | ||
dir | ||
|
||
let AreGtkLibsPresent echoMode = | ||
if Misc.GuessPlatform() <> Misc.Platform.Linux then | ||
failwith "Gtk is only supported in Linux" | ||
|
||
let pkgConfigForGtkProc = Process.Execute({ Command = "pkg-config"; Arguments = "gtk-sharp-2.0" }, echoMode) | ||
match pkgConfigForGtkProc.Result with | ||
| Error _ -> false | ||
| _ -> true | ||
|
||
let FsxRunnerInfo() = | ||
match Misc.GuessPlatform() with | ||
| Misc.Platform.Windows -> | ||
#if !LEGACY_FRAMEWORK | ||
"dotnet", "fsi" | ||
#else | ||
Path.Combine(ScriptsDir.FullName, "fsx", "Tools", "fsi.bat"), String.Empty | ||
#endif | ||
| _ -> | ||
let fsxRunnerBinEnvVar = Environment.GetEnvironmentVariable "FsxRunnerBin" | ||
let fsxRunnerArgEnvVar = Environment.GetEnvironmentVariable "FsxRunnerArg" | ||
if String.IsNullOrEmpty fsxRunnerBinEnvVar then | ||
let msg = "FsxRunnerBin env var not found, it should have been sourced from build.config file" | ||
let msgFull = | ||
msg + Environment.NewLine + | ||
(sprintf "(maybe you 1. %s, or 2. %s, or 3. %s)" | ||
"called this from configure.fsx (which is not supported, just use this func from make.fsx or sanitycheck.fsx)" | ||
"you meant to run a Makefile target rather than this script directly?" | ||
"there is a .sh wrapper script for your .fsx script" | ||
) | ||
failwith msgFull | ||
fsxRunnerBinEnvVar, fsxRunnerArgEnvVar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.