Skip to content

CI

CI #1333

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release/**
pull_request:
types: [opened, synchronize, reopened]
branches:
- main
- release/**
schedule:
- cron: '0 0 * * *' # every day at midnight
env:
GitVersion_Version: 5.10.3
concurrency:
group: ${{github.workflow}} - ${{github.ref}}
cancel-in-progress: true
jobs:
build_tool:
name: Build
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET Core v6
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.100'
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: ${{ env.GitVersion_Version }}
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: gitversion.yml
- name: Build - CI
run: |
$adjustedPackageVersion="${{ steps.gitversion.outputs.semVer }}".ToLower();
dotnet pack -c Release -p:PackageVersion=$adjustedPackageVersion -p:Version=${{ steps.gitversion.outputs.assemblySemVer }} -o .\artifacts UnoCheck\UnoCheck.csproj
- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet
path: .\artifacts
run_tests:
name: Run Unit Tests
needs: build_tool
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.100'
- name: Run Tests
run: |
dotnet test UnoCheck.Tests/UnoCheck.Tests.csproj --configuration Release --verbosity normal
testwin:
name: Validate Tool - Windows - ${{ matrix.manifest_name }}
needs: build_tool
runs-on: windows-latest
strategy:
matrix:
include:
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Stable
tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32'
- manifest: 'manifests\uno.ui-preview.manifest.json'
manifest_name: Preview
tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32'
- manifest: 'manifests\uno.ui-preview-major.manifest.json'
manifest_name: Preview net9
tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32'
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.4.2
previous_tool_params: ''
tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32'
- manifest: 'manifests\uno.ui-preview.manifest.json'
manifest_name: Preview Upgrade
previous_tool_version: 1.4.2
previous_tool_params: '--pre'
tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32'
- manifest: 'manifests\uno.ui-preview-major.manifest.json'
manifest_name: Preview Upgrade net8
previous_tool_version: 1.4.2
previous_tool_params: '--pre'
tool_params: '--target webassembly --target ios --target android --target macos --target linux --target win32'
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Test default Uno template TFM's
tool_params: '--tfm net8.0-android --tfm net8.0-ios --tfm net8.0-maccatalyst --tfm net8.0-windows10.0.19041 --tfm net8.0-browserwasm --tfm net8.0-desktop'
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Test net8.0-android\ios TFM's
tool_params: '--tfm net8.0-android --tfm net8.0-ios'
- manifest: 'manifests\uno.ui.manifest.json'
manifest_name: Test net8.0-browserwasm TFM
tool_params: '--tfm net8.0-browserwasm'
- manifest: 'manifests\uno.ui-preview-major.manifest.json'
manifest_name: Test default Uno template TFM's with net9
tool_params: '--tfm net9.0-android --tfm net9.0-ios --tfm net9.0-maccatalyst --tfm net9.0-windows10.0.19041 --tfm net9.0-browserwasm --tfm net9.0-desktop'
- manifest: 'manifests\uno.ui-preview-major.manifest.json'
manifest_name: Test net9.0-android\ios TFM's
tool_params: '--tfm net9.0-android --tfm net9.0-ios'
- manifest: 'manifests\uno.ui-preview-major.manifest.json'
manifest_name: Test net9.0-browserwasm TFM
tool_params: '--tfm net9.0-browserwasm'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: ${{ github.workspace }}\NuGet
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: ${{ env.GitVersion_Version }}
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: gitversion.yml
- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
& uno-check --ci --fix --non-interactive --verbose --target webassembly --target ios --target android --target macos --target linux --target win32 --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }}
& dotnet tool uninstall --global uno.check
- name: Install and Run Tool
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet\ uno.check
& uno-check --ci --fix --non-interactive --verbose --manifest ${{ matrix.manifest }} --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.tool_params }}
testmac:
name: Validate Tool - macOS - ${{ matrix.manifest_name }}/${{ matrix.os }}
needs: build_tool
strategy:
matrix:
include:
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable
os: macos-14
dotnet_version: 8.0.300
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview
previous_tool_version: ''
previous_tool_params: ''
os: macos-14
dotnet_version: 8.0.300
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.17.0
previous_tool_params: ''
os: macos-14
dotnet_version: 8.0.300
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview Upgrade
previous_tool_version: 1.17.0
previous_tool_params: '--pre'
os: macos-14
dotnet_version: 8.0.300
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Test default Uno template TFM's
os: macos-14
dotnet_version: 8.0.300
tool_params: '--tfm net8.0-android --tfm net8.0-ios --tfm net8.0-maccatalyst --tfm net8.0-windows10.0.19041 --tfm net8.0-browserwasm --tfm net8.0-desktop'
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Test net8.0-android\ios TFM's
os: macos-14
dotnet_version: 8.0.300
tool_params: '--tfm net8.0-android --tfm net8.0-ios'
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Test net8.0-browserwasm TFM
os: macos-14
dotnet_version: 8.0.300
tool_params: '--tfm net8.0-browserwasm'
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable
os: macos-15
dotnet_version: 8.0.300
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: ${{ github.workspace }}/NuGet
# Preinstall .NET as it may fail on some build agents
- name: Setup .NET Core ${{ matrix.dotnet_version }}
uses: actions/setup-dotnet@v1
with:
dotnet-version: '${{ matrix.dotnet_version }}'
# - name: MANUAL WORKLOAD INSTALL
# shell: pwsh
# run: |
# dotnet workload install android ios maccatalyst maui tvos macos --source https://api.nuget.org/v3/index.json
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: ${{ env.GitVersion_Version }}
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: gitversion.yml
- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }}
& dotnet tool uninstall --global uno.check
- name: Install and Run Tool
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet/ uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 --manifest ${{ matrix.manifest }} ${{ matrix.tool_params }}
testlinux:
name: Validate Tool - Linux - ${{ matrix.manifest_name }}
needs: build_tool
runs-on: ubuntu-latest
strategy:
matrix:
include:
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview
- manifest: 'manifests/uno.ui-preview-major.manifest.json'
manifest_name: Preview net9
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Stable Upgrade
previous_tool_version: 1.4.2
previous_tool_params: ''
- manifest: 'manifests/uno.ui-preview.manifest.json'
manifest_name: Preview Upgrade
previous_tool_version: 1.4.2
previous_tool_params: '--pre'
- manifest: 'manifests/uno.ui-preview-major.manifest.json'
manifest_name: Preview Upgrade net8
previous_tool_version: 1.4.2
previous_tool_params: '--pre'
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Test default Uno template TFM's
tool_params: '--tfm net8.0-android --tfm net8.0-ios --tfm net8.0-maccatalyst --tfm net8.0-windows10.0.19041 --tfm net8.0-browserwasm --tfm net8.0-desktop'
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Test net8.0-android\ios TFM's
tool_params: '--tfm net8.0-android --tfm net8.0-ios'
- manifest: 'manifests/uno.ui.manifest.json'
manifest_name: Test net8.0-browserwasm TFM
tool_params: '--tfm net8.0-browserwasm'
- manifest: 'manifests/uno.ui-preview-major.manifest.json'
manifest_name: Test default Uno template TFM's with net9
tool_params: '--tfm net9.0-android --tfm net9.0-ios --tfm net9.0-maccatalyst --tfm net9.0-windows10.0.19041 --tfm net9.0-browserwasm --tfm net9.0-desktop'
- manifest: 'manifests/uno.ui-preview-major.manifest.json'
manifest_name: Test net9.0-android\ios TFM's
tool_params: '--tfm net9.0-android --tfm net9.0-ios'
- manifest: 'manifests/uno.ui-preview-major.manifest.json'
manifest_name: Test net9.0-browserwasm TFM
tool_params: '--tfm net9.0-browserwasm'
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: ${{ github.workspace }}/NuGet
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '8.0.100'
- name: Setup GitVersion
uses: gittools/actions/gitversion/setup@v0.9.9
with:
versionSpec: ${{ env.GitVersion_Version }}
- name: GitVersion
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.9
with:
useConfigFile: true
configFilePath: gitversion.yml
- uses: actions/setup-java@v3
with:
distribution: 'microsoft' # See 'Supported distributions' for available options
java-version: '11'
- name: Install and Run Previous Tool
if: ${{ contains(matrix.previous_tool_version, '.') }}
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet --list-sdks
& dotnet tool install --global --version ${{ matrix.previous_tool_version }} uno.check
& uno-check --ci --fix --non-interactive --verbose --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.previous_tool_params }}
& dotnet tool uninstall --global uno.check
- name: Install and Run Tool
shell: pwsh
run: |
Write-Output "PACKAGE VERSION: ${{ steps.gitversion.outputs.semVer }}"
$ProgressPreference = 'SilentlyContinue'
& dotnet tool install --global --version ${{ steps.gitversion.outputs.semVer }} --add-source NuGet/ uno.check
& uno-check --ci --fix --verbose --non-interactive --verbose --manifest ${{ matrix.manifest }} --skip xcode --skip vswin --skip vsmac --skip wsl --skip edgewebview2 ${{ matrix.tool_params }}
sign:
name: Sign Package
if: ${{ github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) }}
runs-on: windows-latest
needs:
- build_tool
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet
path: artifacts\NuGet
- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Setup SignClient
run: |
dotnet tool install --tool-path build SignClient
- name: SignClient
shell: pwsh
run: |
build\SignClient sign -i artifacts\NuGet\*.nupkg -c build\SignClient.json -r "${{ secrets.UNO_PLATFORM_CODESIGN_USERNAME }}" -s "${{ secrets.UNO_PLATFORM_CODESIGN_SECRET }}" -n "Uno.Check" -d "Uno.Check" -u "https://github.com/unoplatform/uno.check"
- name: Upload Signed Artifacts
uses: actions/upload-artifact@v4
with:
name: NuGet-Signed
path: .\artifacts\NuGet
publish_dev:
name: Publish Dev
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
runs-on: windows-latest
needs:
- sign
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet-Signed
path: artifacts
- name: NuGet Push
shell: pwsh
run: |
dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k "${{ secrets.NUGET_ORG_API_KEY }}"
publish_prod:
name: Publish Production
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/heads/release/') }}
runs-on: windows-latest
environment: Production
needs:
- sign
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: NuGet-Signed
path: artifacts
- name: NuGet Push
shell: pwsh
run: |
dotnet nuget push artifacts\*.nupkg -s https://api.nuget.org/v3/index.json -k "${{ secrets.NUGET_ORG_API_KEY }}"