Add all other project types #74
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
pull_request: | |
types: [opened] | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
DOTNET_ROLL_FORWARD: Major | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/[email protected] | |
with: | |
dotnet-version: 9.0 | |
- name: Restore tools | |
run: dotnet tool restore | |
- name: Begin scan | |
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' | |
run: dotnet sonarscanner begin /o:"kaliumhexacyanoferrat" /k:"Kaliumhexacyanoferrat_GenHTTP.Templates" /d:sonar.token="$SONAR_TOKEN" /d:sonar.exclusions="**/bin/**/*,**/obj/**/*" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.branch.name="${GITHUB_REF##*/}" | |
- name: Build project | |
run: dotnet build GenHTTP.Templates.csproj -c Release | |
- name: End scan | |
if: env.SONAR_TOKEN != null && env.SONAR_TOKEN != '' | |
run: dotnet sonarscanner end /d:sonar.token="$SONAR_TOKEN" | |
- name: Install templates | |
run: dotnet new install . | |
- name: Test webservice framework | |
run: | | |
mkdir -p /tmp/genhttp/webservice/ | |
cd /tmp/genhttp/webservice/ | |
dotnet new genhttp-webservice | |
cd webservice.Tests | |
dotnet test | |
- name: Test controller framework | |
run: | | |
mkdir -p /tmp/genhttp/controllers/ | |
cd /tmp/genhttp/controllers/ | |
dotnet new genhttp-webservice-controllers | |
cd controllers.Tests | |
dotnet test | |
- name: Test minimal framework | |
run: | | |
mkdir -p /tmp/genhttp/minimal/ | |
cd /tmp/genhttp/minimal/ | |
dotnet new genhttp-webservice-minimal | |
cd minimal.Tests | |
dotnet test | |
- name: Test static website | |
run: | | |
mkdir -p /tmp/genhttp/static/ | |
cd /tmp/genhttp/static/ | |
dotnet new genhttp-website-static | |
cd static.Tests | |
dotnet test | |
- name: Test SPA | |
run: | | |
mkdir -p /tmp/genhttp/spa/ | |
cd /tmp/genhttp/spa/ | |
dotnet new genhttp-spa | |
cd spa.Tests | |
dotnet test | |
- name: Test websockets | |
run: | | |
mkdir -p /tmp/genhttp/websockets/ | |
cd /tmp/genhttp/websockets/ | |
dotnet new genhttp-websocket | |
cd websockets.Tests | |
dotnet test |