Implement new algorithm for calculating the rankings #611
Workflow file for this run
This file contains hidden or 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
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| types: [opened, synchronize, reopened] | |
| jobs: | |
| validate: | |
| name: 'Validate' | |
| runs-on: ubuntu-24.04 | |
| env: | |
| RUN_SONARQUBE_ANALYSIS: ${{ secrets.SONAR_TOKEN != '' }} | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Setup .NET SDK 10.x' | |
| uses: actions/setup-dotnet@v3 | |
| with: | |
| dotnet-version: '10.x' | |
| - name: 'Setup Node.js 24.x' | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '24.x' | |
| - name: 'Setup Chrome' | |
| uses: browser-actions/setup-chrome@v1 | |
| id: 'setup-chrome' | |
| - name: 'Set CHROME_BIN environment variable' | |
| run: 'echo "CHROME_BIN=${{ steps.setup-chrome.outputs.chrome-path }}" >> $env:GITHUB_ENV' | |
| - name: 'Extract turnierplan.NET version' | |
| shell: pwsh | |
| run: | | |
| $VersionXmlContent = Get-Content -Path "version.xml" -Raw | |
| $Version = [regex]::Match($VersionXmlContent, '<Version>(\d+\.\d+\.\d+)</Version>').Groups[1].Value | |
| Write-Host $Version | |
| Add-Content -Path $env:GITHUB_ENV -Value "TURNIERPLAN_APPLICATION_VERSION=$Version" | |
| working-directory: './src' | |
| - name: Install SonarQube Cloud scanner | |
| if: ${{ env.RUN_SONARQUBE_ANALYSIS == 'true' }} | |
| run: 'dotnet tool install --global dotnet-sonarscanner' | |
| - name: Begin SonarQube Cloud analysis | |
| if: ${{ env.RUN_SONARQUBE_ANALYSIS == 'true' }} | |
| run: 'dotnet-sonarscanner begin /k:"turnierplan-NET_turnierplan.NET" /o:"turnierplan-net" /v:"${{ env.TURNIERPLAN_APPLICATION_VERSION }}" /d:sonar.token="${{ secrets.SONAR_TOKEN }}" /d:sonar.host.url="https://sonarcloud.io" /d:sonar.cs.vscoveragexml.reportsPaths="coverage.xml" /d:sonar.javascript.lcov.reportPaths="**/lcov.info" /d:sonar.coverage.exclusions="**/*.spec.ts,**/*.cy.js" /d:sonar.exclusions="Turnierplan.App/Client/cypress/**/*,Turnierplan.Dal/Migrations/*"' | |
| working-directory: './src' | |
| - name: 'Restore .NET solution' | |
| run: 'dotnet restore' | |
| working-directory: './src' | |
| - name: 'Build .NET solution' | |
| run: 'dotnet build --no-restore -c Release' | |
| working-directory: './src' | |
| - name: 'Install dotnet-coverage' | |
| run: 'dotnet tool install --global dotnet-coverage' | |
| - name: 'Test .NET solution' | |
| run: 'dotnet-coverage collect "dotnet test --no-build -c Release" -f xml -o "coverage.xml"' | |
| working-directory: './src' | |
| - name: 'Install npm packages' | |
| run: 'npm ci' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: 'Build client application' | |
| run: 'npm run build:prod' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: 'Lint client application' | |
| run: 'npm run lint:ci' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: 'Test client application' | |
| run: 'npm run test:ci' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: End SonarQube Cloud analysis | |
| if: ${{ env.RUN_SONARQUBE_ANALYSIS == 'true' }} | |
| run: 'dotnet-sonarscanner end /d:sonar.token="${{ secrets.SONAR_TOKEN }}"' | |
| working-directory: './src' | |
| e2e: | |
| name: 'E2E Tests' | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v2 | |
| with: | |
| fetch-depth: 0 | |
| - name: 'Setup Node.js 24.x' | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '24.x' | |
| - name: 'Install npm packages' | |
| run: 'npm ci' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: 'Prepare e2e test environment' | |
| run: 'npm run e2e:prepare' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: 'Run e2e tests' | |
| run: 'npm run e2e:run' | |
| working-directory: './src/Turnierplan.App/Client/' | |
| - name: 'Destroy e2e test environment' | |
| run: 'npm run e2e:destroy' | |
| working-directory: './src/Turnierplan.App/Client/' |