Skip to content

feat: Add a GitHub Actions workflow for use in CI workflows #339

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 3 commits into
base: main
Choose a base branch
from
Open
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
39 changes: 39 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Uno.Check
description: "GitHub Action to setup a remote environment to build Uno Platform apps"

branding:
icon: 'download'
color: 'red'

inputs:
target-platform:
description: 'The platform to install dependencies for. See available values at https://platform.uno/docs/articles/external/uno.check/doc/using-uno-check.html'
required: false
default: 'all'
dotnet-version:
description: 'Installs and sets the .NET SDK Version'
required: false
default: '9.0.x'

runs:
using: "composite"
steps:
# Install .NET
- name: Setup .NET ${{ inputs.dotnet-version }}
uses: actions/setup-dotnet@v3
with:
dotnet-version: '${{ inputs.dotnet-version }}'

# Run Uno.Check
- name: Install ${{ inputs.target-platform }} Workloads
shell: pwsh
run: |
dotnet tool install -g uno.check
("${{ inputs.target-platform }} ".Split(' ') | ForEach-Object {
$target = $_.Replace("_win", "").Replace("_macos", "")
if (![string]::IsNullOrEmpty($target)) {
echo "target: $target"
uno-check -v --ci --non-interactive --fix --target $target --skip vswin --skip vsmac --skip xcode --skip vswinworkloads --skip androidemulator --skip dotnetnewunotemplates
echo "uno-check finished for target: $target "
}
})
Comment on lines +28 to +39
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably could avoid running uno-check in a loop by adding multiple --target options instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?
This is the standard behaviour of the mini-workflow step included in the Uno platform template.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah! That's right, then the other one probably should be changed as well, but that will do for now then.