Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow combine #385

Merged
merged 27 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
dc4016c
Update push.yml (#368) (#370)
Jim8y Nov 24, 2023
b5c62c8
Update push.yml (#368) (#372)
Jim8y Nov 24, 2023
b31f0ed
Merge branch 'master' into development
Jim8y Nov 24, 2023
42ea59e
Fixed pr and push and default config for projects
cschuchardt88 Nov 24, 2023
de1495e
change step name
cschuchardt88 Nov 24, 2023
ef3ac6d
Added names to the steps
cschuchardt88 Nov 24, 2023
c434d40
changed workflow names
cschuchardt88 Nov 24, 2023
0574360
fixed up *.csproj
cschuchardt88 Nov 24, 2023
1ecfd80
fixed issue with packing on neoxp
cschuchardt88 Nov 24, 2023
c8d47f1
fixed deps
cschuchardt88 Nov 24, 2023
b6f91c0
fixed deps again
cschuchardt88 Nov 24, 2023
265624c
fixed debug embed
cschuchardt88 Nov 24, 2023
d6c864b
removed debug from neoxp
cschuchardt88 Nov 24, 2023
9bbc9da
Merge branch 'master' into workflow-combine
cschuchardt88 Nov 25, 2023
334a405
changed name back
cschuchardt88 Nov 26, 2023
b463392
Merge branch 'workflow-combine' of https://github.com/cschuchardt88/n…
cschuchardt88 Nov 26, 2023
b75e73a
workflow name change
cschuchardt88 Nov 26, 2023
b7515d5
nevermind changed back
cschuchardt88 Nov 26, 2023
d6ff0ac
changed name workflow back
cschuchardt88 Nov 26, 2023
1bfd8a3
Update test.yml
cschuchardt88 Nov 26, 2023
df64b05
Spread out myget packages in to steps for upload
cschuchardt88 Nov 26, 2023
67ebcf7
Merge branch 'workflow-combine' of https://github.com/cschuchardt88/n…
cschuchardt88 Nov 26, 2023
b5ee8ad
Merge branch 'master' into workflow-combine
Jim8y Nov 26, 2023
3bafd04
Update .github/workflows/pack.yml
Jim8y Nov 26, 2023
2f0e1fa
Update .github/workflows/pr.yml
Jim8y Nov 26, 2023
aeb76eb
Update .github/workflows/pr.yml
Jim8y Nov 26, 2023
f2c44c2
Update .github/workflows/pr.yml
Jim8y Nov 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 0 additions & 58 deletions .github/workflows/neoxp.yml

This file was deleted.

47 changes: 36 additions & 11 deletions .github/workflows/pack.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Pack
name: Release (MyGet)

on:
workflow_call:
Expand Down Expand Up @@ -38,21 +38,46 @@ jobs:
run: |
dotnet format neo-express.sln --verify-no-changes --verbosity diagnostic

- name: Restore
run: dotnet restore neo-express.sln

- name: Build
run: dotnet build neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-restore --verbosity normal --BinaryLogger:./msbuild.binlog

- name: Pack
run: |
dotnet restore neo-express.sln
dotnet build neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-restore --verbosity normal --BinaryLogger:./msbuild.binlog
dotnet pack neo-express.sln --configuration ${{ env.CONFIGURATION }} --output ./out --no-build --verbosity normal
run: dotnet pack neo-express.sln --configuration ${{ env.CONFIGURATION }} --output ./out --no-build --verbosity normal

- name: Publish Package to MyGet (Neo.Assertions)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.Assertions.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Publish Package to MyGet (Neo.BlockchainToolkit)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.BlockchainToolkit.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Publish Package to MyGet (Neo.BuildTasks)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.BuildTasks.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Publish Package to MyGet (Neo.Collector)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.Collector.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Publish Package to MyGet (Neo.Express)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.Express.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Publish Package to MyGet (Neo.Test.Harness)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.Test.Harness.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Publish Package to MyGet (Neo.Test.Runner)
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development')
run: dotnet nuget push ./out/Neo.Test.Runner.*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}

- name: Upload Build Log
if: always()
uses: actions/upload-artifact@v3
with:
name: buildlog
path: ./msbuild.binlog

- name: Upload NeoExpress
uses: actions/upload-artifact@v3
with:
name: packages
path: ./out/*.nupkg
10 changes: 5 additions & 5 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
pull_request:
branches:
- master
- development
- release/*
paths-ignore:
- '.gitignore'
Expand All @@ -12,10 +13,9 @@ on:
- '**/*.md'

jobs:
pack:
uses: ./.github/workflows/pack.yml
test:
uses: ./.github/workflows/test.yml
Jim8y marked this conversation as resolved.
Show resolved Hide resolved
neoxp:
needs: [pack, test]
uses: ./.github/workflows/neoxp.yml
pack:
name: pack
needs: [test]
uses: ./.github/workflows/pack.yml
26 changes: 6 additions & 20 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- master
- development
- release/*
paths-ignore:
- '.gitignore'
Expand All @@ -15,25 +16,10 @@ env:
DOTNET_VERSION: '7.0.x'

jobs:
pack:
uses: ./.github/workflows/pack.yml
test:
name: Test Application
uses: ./.github/workflows/test.yml
publish:
needs: [pack, test]
runs-on: ubuntu-latest

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Download Express
uses: actions/download-artifact@v3
with:
name: packages
path: ./out

- name: Publish to Azure Artifacts
run: dotnet nuget push ./out/*.nupkg --source https://www.myget.org/F/neo/api/v3/index.json --api-key ${{ secrets.MYGET_TOKEN }}
pack:
name: MyGet Release
needs: [test]
uses: ./.github/workflows/pack.yml
28 changes: 3 additions & 25 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ on:

jobs:
standalone:
name: Standalone Build
if: startsWith(github.ref, 'refs/heads/release/')
uses: ./.github/workflows/standalone.yml

build:
name: Standalone Pack/Release/Publish
if: startsWith(github.ref, 'refs/heads/release/')
needs: [standalone]
runs-on: ubuntu-latest
Expand All @@ -31,31 +33,7 @@ jobs:
run: dotnet restore neo-express.sln

- name: Pack NeoExpress
run: dotnet pack src/neoxp --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoTrace
run: dotnet pack src/trace --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoWorkNet
run: dotnet pack src/worknet --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack BlockchainToolkitLibrary
run: dotnet pack src/bctklib --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoAssertions
run: dotnet pack src/assertions --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoBuildTasks
run: dotnet pack src/build-tasks --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoCollector
run: dotnet pack src/collector --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoTestRunner
run: dotnet pack src/runner --output ./dist --configuration Release --no-restore --verbosity normal

- name: Pack NeoTestHarness
run: dotnet pack src/test-harness --output ./dist --configuration Release --no-restore --verbosity normal
run: dotnet pack neo-express.sln --output ./dist --configuration Release --no-restore --verbosity normal

- name: Download Express Files (Standalone)
uses: actions/download-artifact@v3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/standalone.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Run Standalone / Build / Pack
name: Standalone Build

on:
workflow_call:
Expand All @@ -12,6 +12,7 @@ env:

jobs:
osx-pack:
name: MacOS x64/arm64
runs-on: macos-latest

steps:
Expand Down Expand Up @@ -109,6 +110,7 @@ jobs:
${{ env.UNIX_DIST_DIR }}/*

linux-pack:
name: Linux x64/arm64
runs-on: ubuntu-latest
steps:
- name: Checkout Code
Expand Down Expand Up @@ -236,6 +238,7 @@ jobs:
${{ env.UNIX_DIST_DIR }}/*

win-pack:
name: Windows x64/arm64
runs-on: windows-latest
steps:
- name: Checkout Code
Expand Down
64 changes: 53 additions & 11 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,20 @@ jobs:
with:
dotnet-version: ${{ env.DOTNET_VERSION }}

- name: Install RocksDB Dependencies
if: ${{ runner.os == 'Linux'}}
run: |
sudo apt-get update
sudo apt-get install libsnappy-dev libc6-dev librocksdb-dev -y
# - name: Install RocksDB Dependencies
# if: ${{ runner.os == 'Linux'}}
# run: |
# sudo apt-get update
# sudo apt-get install libsnappy-dev libc6-dev librocksdb-dev -y

- name: Build and Test
run: |
dotnet restore neo-express.sln
dotnet build neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-restore --verbosity normal --BinaryLogger:./msbuild.${{ matrix.os }}.binlog
dotnet test neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal --collect:"XPlat Code Coverage"
- name: Restore
run: dotnet restore neo-express.sln

- name: Build
run: dotnet build neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-restore --verbosity normal --BinaryLogger:./msbuild.${{ matrix.os }}.binlog

- name: Test
run: dotnet test neo-express.sln --configuration ${{ env.CONFIGURATION }} --no-build --verbosity normal --collect:"XPlat Code Coverage"

- name: Upload Coverage
uses: actions/upload-artifact@v3
Expand All @@ -49,8 +52,47 @@ jobs:
name: buildlog
path: ./msbuild.${{ matrix.os }}.binlog

- name: Pack for Install
run: dotnet pack neo-express.sln --configuration ${{ env.CONFIGURATION }} --output ./out --no-build --verbosity normal

- name: Install neoxp tool
run: dotnet tool install --add-source ./out --verbosity normal --global --prerelease neo.express

- name: Test Create Command (neoxp)
run: neoxp create

- name: Test Checkpoint Command (offline) (neoxp)
run: neoxp checkpoint create checkpoints/init --force

- name: Test Policy Command (offline) (neoxp)
run: |
neoxp policy get --rpc-uri mainnet --json > mainnet-policy.json
neoxp policy sync mainnet-policy --account genesis

- name: Test Wallet Command (neoxp)
run: |
neoxp wallet create bob

- name: Test Transfer Command (offline) (neoxp)
run: |
neoxp transfer 10000 gas genesis node1
neoxp transfer 10000 gas genesis bob

- name: Test Run Command (online) (neoxp)
timeout-minutes: 1
run: neoxp run --seconds-per-block 3 --discard &

- name: Test Transfer Command (online) (neoxp)
run: |
neoxp transfer 10000 gas genesis node1
neoxp transfer 10000 gas genesis bob

- name: Test Stop Command (online) (neoxp)
run: neoxp stop --all

report:
needs: build
name: Build Coverage (Report)
needs: [build]
runs-on: ubuntu-latest

steps:
Expand Down
4 changes: 3 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<Authors>The Neo Project</Authors>
<Company>The Neo Project</Company>
<Copyright>2015-2023 The Neo Project</Copyright>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<LangVersion>10</LangVersion>
<Nullable>enable</Nullable>
Expand All @@ -13,8 +14,9 @@
<PackageTags>Neo;Blockchain;Smart Contract</PackageTags>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/neo-project/neo-express.git</RepositoryUrl>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<TargetFramework>net7.0</TargetFramework>
<ApplicationIcon>../neo-cli.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<NeoVersion>3.6.2</NeoVersion>
Expand Down
2 changes: 0 additions & 2 deletions src/assertions/assertions.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@
<RootNamespace>Neo.Assertions</RootNamespace>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
Expand Down
5 changes: 2 additions & 3 deletions src/bctklib/bctklib.csproj
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DebugType>Embedded</DebugType>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<IncludeSymbols>true</IncludeSymbols>
<PackageId>Neo.BlockchainToolkit</PackageId>
<RootNamespace>Neo.BlockchainToolkit</RootNamespace>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
<DebugType>Embedded</DebugType>
</PropertyGroup>

<PropertyGroup Condition="'$(CI)' == 'true'">
Expand Down
2 changes: 0 additions & 2 deletions src/collector/collector.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
<TargetFrameworks>netstandard2.0;net472</TargetFrameworks>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
Expand Down
Binary file added src/neo-cli.ico
Binary file not shown.
2 changes: 0 additions & 2 deletions src/test-harness/test-harness.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
<RootNamespace>NeoTestHarness</RootNamespace>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<DebugType>Embedded</DebugType>
<IncludeSymbols>true</IncludeSymbols>
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
</PropertyGroup>

<ItemGroup>
Expand Down