Skip to content

Setup CI to run e2e tests #110

Setup CI to run e2e tests

Setup CI to run e2e tests #110

Workflow file for this run

# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net
name: .NET
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
name: Builds the entire solution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.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
tests:
name: Run Unit Tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.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:
name: Run End To End Tests
runs-on: ubuntu-latest
needs: build
steps:
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.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: Ensure browsers are installed
run: pwsh ./src/NodeDev.EndToEndTests/bin/Debug/net8.0/playwright.ps1 install --with-deps
- name: Test
working-directory: ./src/NodeDev.EndToEndTests
env:
NodeDevServerPath: ../NodeDev.Blazor.Server
run: dotnet test --no-build --verbosity normal