Skip to content

Commit

Permalink
Combined build and test since with need to build before testing
Browse files Browse the repository at this point in the history
  • Loading branch information
JordanFiset committed Nov 23, 2024
1 parent 1e6dc3f commit fc049a9
Show file tree
Hide file tree
Showing 3 changed files with 97 additions and 15 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ on:
branches: [ "master" ]

jobs:
build:
uses: ./.github/workflows/workflow-build.yml

tests:
uses: ./.github/workflows/workflow-tests.yml
build-and-test:
uses: ./.github/workflows/workflow-build-and-test.yml

e2e-tests:
uses: ./.github/workflows/workflow-e2e-tests.yml
10 changes: 2 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@ permissions:
contents: write

jobs:
build:
uses: ./.github/workflows/workflow-build.yml

tests:
uses: ./.github/workflows/workflow-tests.yml

e2e-tests:
uses: ./.github/workflows/workflow-e2e-tests.yml
build-and-test:
uses: ./.github/workflows/workflow-build-and-test.yml

publish:
name: Publish and package
Expand Down
93 changes: 93 additions & 0 deletions .github/workflows/workflow-build-and-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: .Build and Tests

on:
workflow_call:

jobs:
build:
name: .Build the entire solution
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

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

e2e-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@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

0 comments on commit fc049a9

Please sign in to comment.