Build, Test And Create Nuget Package #16
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: Build, Test And Create Nuget Package | |
on: | |
push: | |
branches: [ main ] | |
workflow_dispatch: | |
jobs: | |
main: | |
name: ${{ matrix.runtime.name }} | |
runs-on: ${{ matrix.runtime.runs-on }} | |
container: ${{ matrix.runtime.container }} | |
strategy: | |
fail-fast: false | |
matrix: | |
runtime: | |
- name: win-x64 | |
runs-on: windows-latest-large | |
- name: win-x86 | |
runs-on: windows-latest-large | |
- name: linux-x64 | |
runs-on: ubuntu-latest-large | |
container: ubuntu:24.04 | |
- name: linux-arm64 | |
runs-on: [self-hosted, linux, arm64] | |
container: ubuntu:24.04 | |
- name: linux-musl-x64 | |
runs-on: ubuntu-latest-large | |
container: alpine:3.18 | |
- name: osx-x64 | |
runs-on: macos-latest-large | |
- name: osx-arm64 | |
runs-on: macos-latest-xlarge | |
steps: | |
- name: Checkout sources | |
uses: actions/checkout@v4 | |
- name: Install Build Tools (Linux) | |
if: matrix.runtime.name == 'linux-x64' || matrix.runtime.name == 'linux-arm64' | |
shell: sh | |
run: | | |
apt update --yes | |
apt upgrade --yes | |
# required by actions/setup-dotnet | |
apt install bash wget --yes | |
- name: Install Build Tools (Alpine) | |
if: matrix.runtime.name == 'linux-musl-x64' | |
shell: sh | |
run: | | |
apk update | |
apk upgrade | |
# required by actions/setup-dotnet | |
apk add bash wget | |
# required by dotnet build command | |
apk add libstdc++ libgcc | |
- name: Setup dotnet | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '8.0.x' | |
- name: Build solution | |
shell: bash | |
working-directory: ./Source | |
env: | |
TEST_SHOW_RESULTS: false | |
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 | |
run: | | |
dotnet build --configuration Release --property WarningLevel=0 | |
dotnet test QuestPDF.UnitTests --configuration Release --runtime ${{ matrix.runtime.name }} | |
dotnet test QuestPDF.LayoutTests --configuration Release --runtime ${{ matrix.runtime.name }} | |
dotnet test QuestPDF.Examples --configuration Release --runtime ${{ matrix.runtime.name }} | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
if: ${{ matrix.runtime.name == 'win-x64' }} | |
with: | |
name: Build Package | |
path: | | |
**/*.nupkg | |
**/*.snupkg | |
!.nuget |