webtestpractice/.gitea/workflows/msbuild.yaml

49 lines
1.8 KiB
YAML

name: msbuild
on: [push]
env:
BUILD_TYPE: Release
jobs:
build:
runs-on: dotnet7
steps:
- name: Prep for local builds
run: echo "${LOCIP} gitea.comnenos" >> /etc/hosts
- name: Install Node
run: apt update && apt install -y ca-certificates curl gnupg && curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && NODE_MAJOR=20 && echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && apt update && apt install nodejs -y
- name: Checkout Repository
run: echo "Install repos..."
- uses: actions/checkout@v2
- name: Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'
- name: Install PowerShell
run: dotnet tool install PowerShell -g --version 7.2 && export PATH="$PATH:/root/.dotnet/tools"
- name: Where Am I
shell: bash
working-directory: ${{runner.workspace}}
run: export PATH="$PATH:/root/.dotnet/tools" && pwd && ls -l && dotnet --info && pwsh --version
- name: Start Web App
shell: bash
working-directory: ${{runner.workspace}}
run: cd MyWebApp && ./runwebapp.sh
- name: Build Playwright & Add Dependencies
shell: bash
working-directory: ${{runner.workspace}}
run: export PATH="$PATH:/root/.dotnet/tools" && cd PlaywrightTests && dotnet build && pwsh bin/Debug/net7.0/playwright.ps1 install && pwsh bin/Debug/net7.0/playwright.ps1 install-deps
- name: Run Playwright Tests
shell: bash
working-directory: ${{runner.workspace}}
run: cd PlaywrightTests && dotnet test