-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into add/plugins-yml
- Loading branch information
Showing
178 changed files
with
5,164 additions
and
1,717 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Publish (docker-image) | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
env: | ||
DOTNET_VERSION: 8.0.x | ||
DIST_DIR: ./dist | ||
|
||
jobs: | ||
neo-cli-build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Set Application Version (Environment Variable) | ||
run: | | ||
APP_VERSION=$(echo '${{ github.event.release.tag_name }}' | cut -d 'v' -f 2) | ||
echo "APP_VERSION=$APP_VERSION" >> $GITHUB_ENV | ||
- name: Checkout (GitHub) | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Build (neo-cli) | ||
run: | | ||
dotnet publish ./src/Neo.CLI \ | ||
--framework net8.0 \ | ||
--configuration Release \ | ||
--runtime linux-x64 \ | ||
--self-contained true \ | ||
--output ${{ env.DIST_DIR }} \ | ||
--verbosity normal \ | ||
-p:VersionPrefix=${{ env.APP_VERSION }} \ | ||
-p:RuntimeIdentifier=linux-x64 \ | ||
-p:SelfContained=true \ | ||
-p:IncludeNativeLibrariesForSelfExtract=false \ | ||
-p:PublishTrimmed=false \ | ||
-p:PublishSingleFile=true \ | ||
-p:PublishReadyToRun=true \ | ||
-p:EnableCompressionInSingleFile=true \ | ||
-p:DebugType=embedded \ | ||
-p:ServerGarbageCollection=true | ||
- name: Build (LevelDbStore) | ||
run: | | ||
dotnet build ./src/Plugins/LevelDBStore \ | ||
--framework net8.0 \ | ||
--configuration Release \ | ||
--output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \ | ||
--verbosity normal \ | ||
-p:VersionPrefix=${{ env.APP_VERSION }} | ||
- name: Remove (junk) | ||
run: | | ||
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/Neo* | ||
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.pdb | ||
rm -v ${{ env.DIST_DIR }}/Plugins/LevelDBStore/*.xml | ||
rm -v ${{ env.DIST_DIR }}/*.xml | ||
- name: Docker Login | ||
run: | | ||
docker login ghcr.io \ | ||
--username ${{ github.repository_owner }} \ | ||
--password ${{ secrets.GITHUB_TOKEN }} | ||
- name: Docker Build | ||
run: | | ||
docker build . \ | ||
--file ./.neo/docker/neo-cli/Dockerfile \ | ||
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:latest \ | ||
--tag ghcr.io/${{ github.repository_owner }}/neo-cli:${{ env.APP_VERSION }} \ | ||
--push |
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
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,8 @@ | ||
FROM debian:stable-slim | ||
|
||
# Install the apt-get packages | ||
RUN apt-get update | ||
RUN apt-get install -y libicu-dev libleveldb-dev screen | ||
|
||
COPY ./dist /opt/neo-cli | ||
RUN ln -s /opt/neo-cli/neo-cli /usr/bin |
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
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
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,122 @@ | ||
// Copyright (C) 2015-2024 The Neo Project. | ||
// | ||
// Benchmarks.Types.cs file belongs to the neo project and is free | ||
// software distributed under the MIT software license, see the | ||
// accompanying file LICENSE in the main directory of the | ||
// repository or http://www.opensource.org/licenses/mit-license.php | ||
// for more details. | ||
// | ||
// Redistribution and use in source and binary forms with or without | ||
// modifications are permitted. | ||
|
||
using BenchmarkDotNet.Attributes; | ||
using Array = Neo.VM.Types.Array; | ||
|
||
namespace Neo.VM.Benchmark; | ||
|
||
public class Benchmarks_Types | ||
{ | ||
public IEnumerable<(int Depth, int ElementsPerLevel)> ParamSource() | ||
{ | ||
int[] depths = [2, 4]; | ||
int[] elementsPerLevel = [2, 4, 6]; | ||
|
||
foreach (var depth in depths) | ||
{ | ||
foreach (var elements in elementsPerLevel) | ||
{ | ||
if (depth <= 8 || elements <= 2) | ||
{ | ||
yield return (depth, elements); | ||
} | ||
} | ||
} | ||
} | ||
|
||
[ParamsSource(nameof(ParamSource))] | ||
public (int Depth, int ElementsPerLevel) Params; | ||
|
||
[Benchmark] | ||
public void BenchNestedArrayDeepCopy() | ||
{ | ||
var root = new Array(new ReferenceCounter()); | ||
CreateNestedArray(root, Params.Depth, Params.ElementsPerLevel); | ||
_ = root.DeepCopy(); | ||
} | ||
|
||
[Benchmark] | ||
public void BenchNestedArrayDeepCopyWithReferenceCounter() | ||
{ | ||
var referenceCounter = new ReferenceCounter(); | ||
var root = new Array(referenceCounter); | ||
CreateNestedArray(root, Params.Depth, Params.ElementsPerLevel, referenceCounter); | ||
_ = root.DeepCopy(); | ||
} | ||
|
||
[Benchmark] | ||
public void BenchNestedTestArrayDeepCopy() | ||
{ | ||
var root = new TestArray(new ReferenceCounter()); | ||
CreateNestedTestArray(root, Params.Depth, Params.ElementsPerLevel); | ||
_ = root.DeepCopy(); | ||
} | ||
|
||
[Benchmark] | ||
public void BenchNestedTestArrayDeepCopyWithReferenceCounter() | ||
{ | ||
var referenceCounter = new ReferenceCounter(); | ||
var root = new TestArray(referenceCounter); | ||
CreateNestedTestArray(root, Params.Depth, Params.ElementsPerLevel, referenceCounter); | ||
_ = root.DeepCopy(); | ||
} | ||
|
||
private static void CreateNestedArray(Array? rootArray, int depth, int elementsPerLevel = 1, ReferenceCounter? referenceCounter = null) | ||
{ | ||
if (depth < 0) | ||
{ | ||
throw new ArgumentException("Depth must be non-negative", nameof(depth)); | ||
} | ||
|
||
if (rootArray == null) | ||
{ | ||
throw new ArgumentNullException(nameof(rootArray)); | ||
} | ||
|
||
if (depth == 0) | ||
{ | ||
return; | ||
} | ||
|
||
for (var i = 0; i < elementsPerLevel; i++) | ||
{ | ||
var childArray = new Array(referenceCounter); | ||
rootArray.Add(childArray); | ||
CreateNestedArray(childArray, depth - 1, elementsPerLevel, referenceCounter); | ||
} | ||
} | ||
|
||
private static void CreateNestedTestArray(TestArray rootArray, int depth, int elementsPerLevel = 1, ReferenceCounter referenceCounter = null) | ||
Check warning on line 98 in benchmarks/Neo.VM.Benchmarks/Benchmarks.Types.cs
|
||
{ | ||
if (depth < 0) | ||
{ | ||
throw new ArgumentException("Depth must be non-negative", nameof(depth)); | ||
} | ||
|
||
if (rootArray == null) | ||
{ | ||
throw new ArgumentNullException(nameof(rootArray)); | ||
} | ||
|
||
if (depth == 0) | ||
{ | ||
return; | ||
} | ||
|
||
for (var i = 0; i < elementsPerLevel; i++) | ||
{ | ||
var childArray = new TestArray(referenceCounter); | ||
rootArray.Add(childArray); | ||
CreateNestedTestArray(childArray, depth - 1, elementsPerLevel, referenceCounter); | ||
} | ||
} | ||
} |
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.