Skip to content
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

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Lamparter
Copy link

This PR implements an alternative way for consuming Uno.Check - from GitHub Actions.
This will appear in the GitHub Marketplace once a release on the repo is published or a tag is created.

This also removes the need for the massive unnecessary workflow files shipped with the Uno templates wizard downstream.


name: Example Workflow
on: [push]

jobs:
  build:
    runs-on: windows-latest
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      - name: Install Uno Platform workload
        uses: unoplatform/uno.check@[version]
        with:
          target-platform: 'all'
          dotnet-version: '8.0.x'
          sdk-version: '19041'

@CLAassistant
Copy link

CLAassistant commented Feb 8, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@jeromelaban jeromelaban left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! A few adjustments are needed but this is a good addition!

action.yml Outdated Show resolved Hide resolved
Comment on lines +40 to +51
- 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 "
}
})
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.

Copy link
Member

@jeromelaban jeromelaban left a comment

Choose a reason for hiding this comment

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

A few additional comments.

Comment on lines +40 to +51
- 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 "
}
})
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.

action.yml Outdated Show resolved Hide resolved
Co-authored-by: Jérôme Laban <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants