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

Change pipeline workflow #59

Merged
merged 11 commits into from
Nov 30, 2024
82 changes: 4 additions & 78 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,90 +11,16 @@ on:

jobs:
build:
name: Builds the entire solution
runs-on: windows-latest
name: Build the entire solution
uses: ./.github/workflows/workflow-build.yml

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore .NET dependencies
working-directory: ./src
run: dotnet restore

- name: Build
working-directory: ./src
run: dotnet build --no-restore

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: buildArtifact
path: ./src
retention-days: 7

tests:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: build

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- uses: actions/download-artifact@v4
with:
name: buildArtifact
path: ./src

- name: Test
working-directory: ./src/NodeDev.Tests
run: dotnet test --no-build --verbosity normal
uses: ./.github/workflows/workflow-tests.yml

e2e-tests:
name: Run End To End Tests
runs-on: ubuntu-latest
needs: build
uses: ./.github/workflows/workflow-e2e-tests.yml

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- uses: actions/download-artifact@master
with:
name: buildArtifact
path: ./src

- name: Build Necessary for Playwright
working-directory: ./src/NodeDev.EndToEndTests
run: dotnet build

- name: Allow run
run: chmod -R +x ./src/NodeDev.Blazor.Server/bin

- name: Ensure browsers are installed
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps

- name: Test
env:
HEADLESS: true
working-directory: ./src/NodeDev.EndToEndTests
run: dotnet test --no-build --verbosity normal

- name: Upload std Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: logServer
path: ./src/NodeDev.Blazor.Server/logs
retention-days: 7
89 changes: 7 additions & 82 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,98 +12,23 @@ permissions:

jobs:
build:
name: Build the entire solution
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive
name: .Build the entire solution
uses: ./.github/workflows/workflow-build.yml

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore .NET dependencies
working-directory: ./src
run: dotnet restore

- name: Build
working-directory: ./src
run: dotnet build --no-restore

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: buildArtifact
path: ./src
retention-days: 7

tests:
name: Run Unit Tests
runs-on: ubuntu-latest
name: .Run Unit Tests
needs: build

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- uses: actions/download-artifact@v4
with:
name: buildArtifact
path: ./src

- name: Test
working-directory: ./src/NodeDev.Tests
run: dotnet test --no-build --verbosity normal
uses: ./.github/workflows/workflow-tests.yml

e2e-tests:
name: Run End To End Tests
runs-on: ubuntu-latest
name: .Run End To End Tests
needs: build

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- uses: actions/download-artifact@master
with:
name: buildArtifact
path: ./src

- name: Build Necessary for Playwright
working-directory: ./src/NodeDev.EndToEndTests
run: dotnet build

- name: Allow run
run: chmod -R +x ./src/NodeDev.Blazor.Server/bin

- name: Ensure browsers are installed
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps

- name: Test
env:
HEADLESS: true
working-directory: ./src/NodeDev.EndToEndTests
run: dotnet test --no-build --verbosity normal

- name: Upload std Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: logServer
path: ./src/NodeDev.Blazor.Server/logs
retention-days: 7
uses: ./.github/workflows/workflow-e2e-tests.yml

publish:
name: Publish and package
runs-on: windows-latest
needs: [build, tests, e2e-tests]
needs: [build,tests,e2e-tests]

steps:
- uses: actions/checkout@v4
Expand Down
33 changes: 33 additions & 0 deletions .github/workflows/workflow-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: .Build the entire solution

on:
workflow_call:

jobs:
build:
runs-on: windows-latest

steps:
- uses: actions/checkout@v4
with:
submodules: recursive

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- name: Restore .NET dependencies
working-directory: ./src
run: dotnet restore

- name: Build
working-directory: ./src
run: dotnet build --no-restore

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: buildArtifact
path: ./src
retention-days: 7
43 changes: 43 additions & 0 deletions .github/workflows/workflow-e2e-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: .Run End To End Tests

on:
workflow_call:

jobs:
e2e-tests:
runs-on: ubuntu-latest

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- uses: actions/download-artifact@master
with:
name: buildArtifact
path: ./src

- name: Build Necessary for Playwright
working-directory: ./src/NodeDev.EndToEndTests
run: dotnet build

- name: Allow run
run: chmod -R +x ./src/NodeDev.Blazor.Server/bin

- name: Ensure browsers are installed
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net9.0/playwright.ps1 install --with-deps

- name: Test
env:
HEADLESS: true
working-directory: ./src/NodeDev.EndToEndTests
run: dotnet test --no-build --verbosity normal

- name: Upload std Artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: logServer
path: ./src/NodeDev.Blazor.Server/logs
retention-days: 7
23 changes: 23 additions & 0 deletions .github/workflows/workflow-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: .Run Unit Tests

on:
workflow_call:

jobs:
tests:
runs-on: ubuntu-latest

steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.0.x

- uses: actions/download-artifact@v4
with:
name: buildArtifact
path: ./src

- name: Test
working-directory: ./src/NodeDev.Tests
run: dotnet test --no-build --verbosity normal
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@
/src/NodeDev.Blazor.MAUI/bin/Debug/net9.0-windows10.0.19041.0/win10-x64
/src/NodeDev.Blazor.MAUI/obj
/src/NodeDev.Blazor.MAUI/bin/Release/net9.0-windows10.0.19041.0/win-x64
/src/NodeDev.Blazor.Server/AppOptions.json
/src/NodeDev.Blazor.Server/AppOptions.json
Loading