diff --git a/.github/workflows/benchmark-tests.yml b/.github/workflows/benchmark-tests.yml new file mode 100644 index 0000000..08fc829 --- /dev/null +++ b/.github/workflows/benchmark-tests.yml @@ -0,0 +1,39 @@ +--- +name: Benchmark Tests +on: + pull_request: + paths-ignore: + - '*.md' + - '*.gh*' + +jobs: + build: + strategy: + matrix: + rhino-version: [ '7', '8 WIP' ] + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1 + + - name: Restore Packages + run: nuget restore Crash.sln + + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0 + + - name: Build Crash + run: | + dotnet build src/Crash/ --configuration Release + dotnet build tests/Crash.Benchmark.Tests/ --configuration Release + + # dll changes per rhino version? + # Does this require a headed version of rhino? Or will headless work? + - name: Test + run: | + $path = 'tests/Crash.Benchmark.Tests/bin/Release/net48/*.Tests.dll' + python .\py\nunit-test-runner.py --version ${{ matrix.rhino-version }} --dll $path diff --git a/.github/workflows/end-to-end-tests.yml b/.github/workflows/end-to-end-tests.yml new file mode 100644 index 0000000..741ada6 --- /dev/null +++ b/.github/workflows/end-to-end-tests.yml @@ -0,0 +1,37 @@ +--- +name: End-to-End Tests +on: + pull_request: + paths-ignore: + - '*.md' + - '*.gh*' + +jobs: + build: + strategy: + matrix: + rhino-version: [ '7', '8 WIP' ] + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1 + + - name: Restore Packages + run: nuget restore Crash.sln + + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0 + + - name: Build Crash + run: | + dotnet build src/Crash/ --configuration Release + dotnet build tests/Crash.EndToEnd.Tests/ --configuration Release + + - name: End to End Tests + run: | # dll changes per rhino version? + $path = 'tests/Crash.EndToEnd.Tests/bin/Release/net48/*.Tests.dll' + python .\py\nunit-test-runner.py --version ${{ matrix.rhino-version }} --dll $path diff --git a/.github/workflows/BuildAndTest.yml b/.github/workflows/integration-tests.yml similarity index 53% rename from .github/workflows/BuildAndTest.yml rename to .github/workflows/integration-tests.yml index 8279739..afad3e9 100644 --- a/.github/workflows/BuildAndTest.yml +++ b/.github/workflows/integration-tests.yml @@ -1,5 +1,5 @@ --- -name: BuildAndTest +name: Integration Tests on: pull_request: paths-ignore: @@ -8,6 +8,9 @@ on: jobs: build: + strategy: + matrix: + rhino-version: [ '7', '8 WIP' ] runs-on: windows-latest steps: - uses: actions/checkout@v3 @@ -21,20 +24,13 @@ jobs: - uses: actions/setup-dotnet@v3 with: dotnet-version: | - 6.0 7.0 - name: Build Crash - run: dotnet build Crash.sln --configuration Release + run: | + dotnet build src/Crash/ --configuration Release + dotnet build tests/Crash.Handlers.Tests/ --configuration Release - name: Test run: | - dotnet test Crash.sln - - - name: Test Report - uses: dorny/test-reporter@v1 - if: success() || failure() - with: - name: CRASH Tests - path: tests/**/TestResults/*.trx # Path to test results - reporter: dotnet-trx # Format of test results + dotnet test tests/Crash.Handlers.Tests/ diff --git a/.github/workflows/production-tests.yml b/.github/workflows/production-tests.yml new file mode 100644 index 0000000..b32af18 --- /dev/null +++ b/.github/workflows/production-tests.yml @@ -0,0 +1,38 @@ +--- +name: Benchmark Tests +on: + pull_request: + paths-ignore: + - '*.md' + - '*.gh*' + +jobs: + build: + strategy: + matrix: + rhino-version: [ '7', '8 WIP' ] + runs-on: windows-latest + steps: + + - name: Pull Crash.Server Docker + uses: docker/pull-action + with: + pull: crashserver/crash.server:latest + + - name: Start Docker Container + uses: docker/run + with: + run: docker start crashserver/crash.server:latest -p 5000/5000 + + - name: Install Yak + run: | + python .\py\install-yak.py --version ${{ matrix.rhino-version }} + + - name: Start Crash + run: | + python .\py\start-crash.py --version ${{ matrix.rhino-version }} + + - name: Run Production Tests + run: | + $path = 'tests/Crash.Production.Tests/bin/Release/net48/*.Tests.dll' + python .\py\nunit-test-runner.py --version ${{ matrix.rhino-version }} --dll $path diff --git a/.github/workflows/py/install-yak.py b/.github/workflows/py/install-yak.py new file mode 100644 index 0000000..72eb9b0 --- /dev/null +++ b/.github/workflows/py/install-yak.py @@ -0,0 +1,17 @@ +import subprocess as proc +from glob import glob +import argparse +import os +import sys + +parser = argparse.ArgumentParser() +parser.add_argument("-v", "--version", type=str, default='7', choices=['7', '8 WIP']) + +args = parser.parse_args() + +yak = f'C:\Program Files\Rhino {args.version}\System\Yak.exe' + +# Could use a local package +proc.run( [yak, 'install', 'crash'] ) + +sys.exit(0) \ No newline at end of file diff --git a/.github/workflows/py/nunt-test-runner.py b/.github/workflows/py/nunt-test-runner.py new file mode 100644 index 0000000..a298165 --- /dev/null +++ b/.github/workflows/py/nunt-test-runner.py @@ -0,0 +1,19 @@ +import subprocess as proc +from glob import glob +import argparse +import os +import sys + +parser = argparse.ArgumentParser() +parser.add_argument("-v", "--version", type=str, default='7', choices=['7', '8 WIP']) +parser.add_argument("-d", "--dll", type=str, required=True) + +args = parser.parse_args() + +rhino = f'C:\Program Files\Rhino {args.version}\System\Rhino.exe' +script = f'NUnitTestRunner {args.dll}' +args = f'/nosplash /notemplate /runsript="{script}"' + +proc.run( [rhino, args] ) + +sys.exit(0) \ No newline at end of file diff --git a/.github/workflows/py/start-crash.py b/.github/workflows/py/start-crash.py new file mode 100644 index 0000000..b7d2881 --- /dev/null +++ b/.github/workflows/py/start-crash.py @@ -0,0 +1,18 @@ +import subprocess as proc +from glob import glob +import argparse +import os +import sys + +parser = argparse.ArgumentParser() +parser.add_argument("-v", "--version", type=str, default='7', choices=['7', '8 WIP']) + +args = parser.parse_args() + +rhino = f'C:\Program Files\Rhino {args.version}\System\Rhino.exe' +script = 'OpenSharedModel _Enter _Enter' +args = f'/nosplash /notemplate /runsript="{script}"' + +proc.run( [rhino, args] ) + +sys.exit(0) \ No newline at end of file diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml new file mode 100644 index 0000000..001894e --- /dev/null +++ b/.github/workflows/unit-tests.yml @@ -0,0 +1,33 @@ +--- +name: Unit Tests +on: + pull_request: + paths-ignore: + - '*.md' + - '*.gh*' + +jobs: + build: + runs-on: windows-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup NuGet + uses: NuGet/setup-nuget@v1 + + - name: Restore Packages + run: nuget restore Crash.sln + + - uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 7.0 + + - name: Build Crash + run: | + dotnet build src/Crash/ --configuration Release + dotnet build tests/Crash.Common.Tests/ --configuration Release + + - name: Test + run: | + dotnet test tests/Crash.Common.Tests/ diff --git a/.github/workflows/YakBuild.yml b/.github/workflows/yak-build.yml similarity index 79% rename from .github/workflows/YakBuild.yml rename to .github/workflows/yak-build.yml index 8413ace..5c0f768 100644 --- a/.github/workflows/YakBuild.yml +++ b/.github/workflows/yak-build.yml @@ -27,14 +27,14 @@ jobs: - name: Build Crash run: dotnet build Crash.sln --configuration Release - - name: Build Yak Package for Windows - run: | - $config = "Release" - $in = Resolve-Path("src\Crash\bin\$config\net48") - $out = $in - - .\scripts\YakCompiler.ps1 -Path $in -DestinationPath $out -Config Release -os win - shell: powershell + - id: yak + uses: crashcloud/yak-publish@main + with: + package-name: 'NUnitTestRunner' + token: ${{ secrets.YAK_TOKEN }} + build-path: 'src/bin/**/**/net48/' + publish: 'production' + platform: 'win' - name: Upload Windows Yak Package uses: actions/upload-artifact@v3