Skip to content

Core: better approximation for Label desired size #228

Core: better approximation for Label desired size

Core: better approximation for Label desired size #228

Workflow file for this run

name: Build Controls.Sample.Gtk
on: [push, pull_request]
jobs:
build_and_test:
name: Build & Test
runs-on: ubuntu-22.04
env:
GtkSharpVersion: 3.24.24.95
DotnetVersion: 6.0.400
steps:
- name: Checkout MAUI repo
uses: actions/checkout@v2
# We also tested using 6.0.111 for both projects
# but MAUI failed to build on this version with this error:
# Could not load file or assembly 'Microsoft.CodeAnalysis, Version=4.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
# So instead we use 6.0.400
- name: Setup .NET SDK ${{ env.DotnetVersion }}
uses: actions/[email protected]
with:
dotnet-version: ${{ env.DotnetVersion }}
- name: Add nuget source
run: dotnet nuget add source --name nuget https://api.nuget.org/v3/index.json
- name: Install gtk workload
run: |
# For some reason automatic workload manifest detection doesn't work (see https://github.com/GtkSharp/GtkSharp/issues/355#issuecomment-1446262239 and https://github.com/GtkSharp/GtkSharp/issues/403), so download and unzip mainfest file manually
wget -O gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg https://globalcdn.nuget.org/packages/gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.$GtkSharpVersion.nupkg
DOTNET_DIR=/home/runner/.dotnet
WORKLOAD_MANIFEST_DIR=$DOTNET_DIR/sdk-manifests/${{ env.DotnetVersion }}/gtksharp.net.sdk.gtk
mkdir -p $WORKLOAD_MANIFEST_DIR/
unzip -j gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/
rm gtksharp.net.sdk.gtk.manifest-${{ env.DotnetVersion }}.nupkg
# otherwise we get System.UnauthorizedAccessException: Access to the path '/home/runner/.dotnet/sdk-manifests/6.0.300/gtksharp.net.sdk.gtk/WorkloadManifest.json' is denied.
chmod 764 $WORKLOAD_MANIFEST_DIR/*
dotnet workload search
dotnet workload install gtk --skip-manifest-update
- name: Build MAUI
run: |
dotnet build src/Controls/src/SourceGen/Controls.SourceGen.csproj
dotnet build Microsoft.Maui.Gtk.slnf
- name: Build ZXing.Net.Maui
run: |
dotnet build ./src/ZXing.Net.Maui/ZXing.Net.MAUI/ZXing.Net.MAUI.csproj --framework=net6.0-gtk
dotnet build ./src/ZXing.Net.Maui/ZXing.Net.MAUI.Controls/ZXing.Net.MAUI.Controls.csproj --framework=net6.0-gtk
dotnet-format:
needs: build_and_test
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Run dotnet format
run: |
dotnet format whitespace ./src --folder --exclude Templates/src --exclude ZXing.Net.Maui
git diff --exit-code