Target .NET 8 instead of 7, which is no longer supported. Update depe… #22
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: .NET | |
on: | |
push: | |
branches: [ master ] | |
workflow_dispatch: | |
jobs: | |
build: | |
env: | |
ProjectName: DryerDuty | |
runs-on: ubuntu-latest | |
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 | |
- name: Build | |
run: | | |
dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime linux-arm --no-self-contained | |
dotnet build ${{ env.ProjectName }} --no-restore --configuration Release --runtime linux-arm64 --no-self-contained | |
- name: Publish | |
run: | | |
dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime linux-arm --no-self-contained | |
dotnet publish ${{ env.ProjectName }} --no-build --configuration Release -p:PublishSingleFile=true --runtime linux-arm64 --no-self-contained | |
- name: Test | |
shell: bash | |
run: | | |
dotnet test --configuration Release --collect:"XPlat Code Coverage" --settings Tests/Tests.runsettings --logger "trx;LogFileName=TestResults.xml" | |
echo "TEST_EXIT_CODE=$?" >> $GITHUB_ENV | |
cp Tests/TestResults/*/coverage.info Tests/TestResults | |
exit 0 | |
- name: Upload test report | |
run: testspace Tests/TestResults/TestResults.xml | |
- name: Upload coverage | |
uses: coverallsapp/github-action@master | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: Tests/TestResults/coverage.info | |
- name: Stop if tests failed | |
run: exit ${{ env.TEST_EXIT_CODE }} | |
- name: Upload ARM32 artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}-linux-arm32 | |
path: | | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/${{ env.ProjectName }} | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/appsettings.json | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/*.service | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm/publish/*.so | |
if-no-files-found: error | |
- name: Upload ARM64 artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}-linux-arm64 | |
path: | | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/${{ env.ProjectName }} | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/appsettings.json | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/*.service | |
${{ env.ProjectName }}/bin/Release/net8.0/linux-arm64/publish/*.so | |
if-no-files-found: error |