Skip to content

Feature/net8 test build #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/scripts/install-mono-devel.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#! /bin/sh

sudo apt install dirmngr ca-certificates gnupg -y

sudo gpg --homedir /tmp --no-default-keyring --keyring \
/usr/share/keyrings/mono-official-archive-keyring.gpg \
--keyserver hkp://keyserver.ubuntu.com:80 \
--recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF \
echo "deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/debian stable-buster main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list

sudo apt update

sudo apt install mono-complete -y
76 changes: 27 additions & 49 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,82 +41,60 @@ jobs:
uses: actions/setup-dotnet@v4.2.0
with:
dotnet-version: 8.0.x
- name: "Dotnet Tool Restore"
run: dotnet tool restore
shell: pwsh
- name: "Dotnet Cake Build"
run: dotnet cake --target=Build
shell: pwsh
- name: "Dotnet Cake Test"
run: dotnet cake --target=Test
shell: pwsh
- name: "Dotnet Cake Pack"
run: dotnet cake --target=Pack
shell: pwsh
- name: "Publish Artefacts"
uses: actions/upload-artifact@v3.1.3
if: always()
with:
name: ${{matrix.os}}
path: "./Artefacts"
- name: "Install Mono runtime"
if: matrix.os == 'ubuntu-latest'
run: sudo sh ./.github/scripts/install-mono-devel.sh
shell: sh
- name: "Dotnet Restore"
run: dotnet restore
- name: "Dotnet Build"
run: dotnet build -c Release --no-restore && dotnet build -c Debug --no-restore
- name: "Dotnet Test"
run: dotnet test -c Debug --collect:"XPlat Code Coverage" --logger trx --no-restore --no-build --results-directory ./Artefacts -- RunConfiguration.DisableAppDomain=true
- name: "Dotnet Pack"
run: dotnet pack -c Release --no-build --no-restore --include-source --include-symbols -o ./Artefacts

publish-test-results:
name: "Publish Tests Results"
needs: build
if: always()
permissions:
checks: write
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: "Download Artefact"
uses: actions/download-artifact@v3.0.2
uses: actions/download-artifact@v4.1.8
with:
path: "./Artefacts"
- name: "Publish Test Summary"
uses: test-summary/action@v2
if: always()
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v2.18.0
if: matrix.os == 'ubuntu-latest'
with:
files: "./Artefacts/**/*.trx"
- name: cobertura-report
uses: 5monkeys/cobertura-action@v14
if: matrix.os == 'ubuntu-latest'
with:
paths: "./Artefacts/*/*.xml"
path: "./Artefacts/*/coverage.cobertura.xml"

push-github-packages:
name: "Push GitHub Packages"
needs: build
if: github.ref == 'refs/heads/main' || github.event_name == 'release'
environment:
name: "GitHub Packages"
url: https://github.com/RehanSaeed/Schema.NET/packages
url: https://github.com/multiarc/Schema.NET/packages
permissions:
packages: write
runs-on: windows-latest
runs-on: ubuntu-latest
steps:
- name: "Download Artefact"
uses: actions/download-artifact@v3.0.2
uses: actions/download-artifact@v4.1.8
with:
name: "windows-latest"
- name: "Dotnet NuGet Add Source"
run: dotnet nuget add source https://nuget.pkg.github.com/RehanSaeed/index.json --name GitHub --username RehanSaeed --password ${{secrets.GITHUB_TOKEN}}
run: dotnet nuget update source github --username multiarc --password ${{secrets.GITHUB_TOKEN}} --store-password-in-clear-text
shell: pwsh
- name: "Dotnet NuGet Push"
run: dotnet nuget push .\*.nupkg --api-key ${{ github.token }} --source GitHub --skip-duplicate
shell: pwsh

push-nuget:
name: "Push NuGet Packages"
needs: build
if: github.event_name == 'release'
environment:
name: "NuGet"
url: https://www.nuget.org/packages/Schema.NET
runs-on: windows-latest
steps:
- name: "Download Artefact"
uses: actions/download-artifact@v3.0.2
with:
name: "windows-latest"
- name: "Dotnet NuGet Push"
run: |
Get-ChildItem .\ -Filter *.nupkg |
Where-Object { !$_.Name.Contains('preview') } |
ForEach-Object { dotnet nuget push $_ --source https://api.nuget.org/v3/index.json --skip-duplicate --api-key ${{secrets.NUGET_API_KEY}} }
shell: pwsh
shell: pwsh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup Label="Build">
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0;net6.0;net462;net472;net48</TargetFrameworks>
<TargetFrameworks>net8.0;net6.0;net472;net48</TargetFrameworks>
<IsPackable>false</IsPackable>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
</PropertyGroup>
Expand Down
Loading
Loading