diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7839225..c431238 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cf9723e..0f55efa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/.github/workflows/workflow-build.yml b/.github/workflows/workflow-build.yml new file mode 100644 index 0000000..c1808dd --- /dev/null +++ b/.github/workflows/workflow-build.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/workflow-e2e-tests.yml b/.github/workflows/workflow-e2e-tests.yml new file mode 100644 index 0000000..007f458 --- /dev/null +++ b/.github/workflows/workflow-e2e-tests.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/workflow-tests.yml b/.github/workflows/workflow-tests.yml new file mode 100644 index 0000000..fe45b30 --- /dev/null +++ b/.github/workflows/workflow-tests.yml @@ -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 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 9b47fee..00d7d01 100644 --- a/.gitignore +++ b/.gitignore @@ -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 \ No newline at end of file +/src/NodeDev.Blazor.Server/AppOptions.json