Skip to content

Block runs based on their tags, such as "opener", "checkpoint", "reca… #73

Block runs based on their tags, such as "opener", "checkpoint", "reca…

Block runs based on their tags, such as "opener", "checkpoint", "reca… #73

Workflow file for this run

name: Compile program
on:
push:
branches: [ master ]
workflow_dispatch:
jobs:
compile:
env:
ProjectName: GamesDoneQuickCalendarFactory
strategy:
matrix:
include:
- os: ubuntu-latest
targetPlatform: linux-x64
- os: windows-latest
targetPlatform: win-x64
runs-on: ${{ matrix.os }}
steps:
- name: Clone
uses: actions/checkout@v4
- name: Initialize test reporting
uses: testspace-com/setup-testspace@v1
with:
domain: ${{github.repository_owner}}
- name: Restore
run: dotnet restore --locked-mode --verbosity normal
- name: Build
run: dotnet build ${{ env.ProjectName }} --runtime ${{ matrix.targetPlatform }} --no-restore --configuration Release --no-self-contained
- name: Publish
run: dotnet publish ${{ env.ProjectName }} --runtime ${{ matrix.targetPlatform }} --no-build --configuration Release -p:PublishSingleFile=true --no-self-contained --verbosity normal
- name: Test
shell: bash
run: |
testExitCode=0
dotnet test --runtime ${{ matrix.targetPlatform }} --verbosity normal --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml" || testExitCode=$?
echo "TEST_EXIT_CODE=$testExitCode" >> $GITHUB_ENV
cp Tests/TestResults/*/coverage.info Tests/TestResults
exit 0
- name: Upload test report
run: testspace Tests/TestResults/TestResults.xml
- name: Upload coverage report
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: Tests/TestResults/coverage.info
format: lcov
- name: Stop if tests failed
run: exit ${{ env.TEST_EXIT_CODE }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.ProjectName }}-${{ matrix.targetPlatform }}
path: |
${{ env.ProjectName }}/bin/Release/net8.0/${{ matrix.targetPlatform }}/publish/${{ env.ProjectName }}.exe
${{ env.ProjectName }}/bin/Release/net8.0/${{ matrix.targetPlatform }}/publish/gamesdonequickcalendarfactory
${{ env.ProjectName }}/bin/Release/net8.0/${{ matrix.targetPlatform }}/publish/appsettings.json
${{ env.ProjectName }}/bin/Release/net8.0/${{ matrix.targetPlatform }}/publish/web.config
${{ env.ProjectName }}/bin/Release/net8.0/${{ matrix.targetPlatform }}/publish/Install service.ps1
${{ env.ProjectName }}/bin/Release/net8.0/${{ matrix.targetPlatform }}/publish/gamesdonequickcalendarfactory.service
if-no-files-found: error