Skip to content
This repository has been archived by the owner on Apr 23, 2023. It is now read-only.

Commit

Permalink
Created ideal CI CD Actions
Browse files Browse the repository at this point in the history
  • Loading branch information
clicketyclackety committed Apr 11, 2023
1 parent 9bc5a03 commit 27ea78d
Show file tree
Hide file tree
Showing 9 changed files with 217 additions and 20 deletions.
39 changes: 39 additions & 0 deletions .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
37 changes: 37 additions & 0 deletions .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
@@ -1,5 +1,5 @@
---
name: BuildAndTest
name: Integration Tests
on:
pull_request:
paths-ignore:
Expand All @@ -8,6 +8,9 @@ on:

jobs:
build:
strategy:
matrix:
rhino-version: [ '7', '8 WIP' ]
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -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/
38 changes: 38 additions & 0 deletions .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
17 changes: 17 additions & 0 deletions .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)
19 changes: 19 additions & 0 deletions .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)
18 changes: 18 additions & 0 deletions .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)
33 changes: 33 additions & 0 deletions .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/
Expand Up @@ -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
Expand Down

0 comments on commit 27ea78d

Please sign in to comment.