-
-
Notifications
You must be signed in to change notification settings - Fork 0
GitHub: Added CI workflow #46
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
7a8b241
Initial creation of CI workflow
Lamparter 331f73a
Add reference to `Microsoft.Windows.SDK.CPP`
Lamparter 21bd03a
Add `-p:GITHUB_ACTIONS=true`
Lamparter deab81c
Exclude GlowUI projects from CI build
Lamparter fd17996
Remove GlowUI projects from solution
Lamparter 623fdf2
Remove Release configuration matrix
Lamparter 96e0bec
Create CD workflow
Lamparter 9b71a9b
Fix configuration issue
Lamparter 3b89b7a
Add Release to configuration matrix
Lamparter e80f886
Fix CPP references
Lamparter 673f05e
Sourcelink
Lamparter 39edcfd
Enable AOT compatibility only on net8.0-windows for CsWin32 project
Lamparter 68ee49d
Super!
Lamparter f8555df
Build on x64
Lamparter 670dc5f
Include/Exclude
Lamparter 1c2214d
With release/debug specifications for excludes
Lamparter 3f2f6b8
Change order of matrixes
Lamparter 9776ebf
Convert package references into project references
Lamparter 342f78e
Rewrite CD workflow
Lamparter 74ad8b8
Update CD
Lamparter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| param ( | ||
| [string]$Project, | ||
| [string]$Head, | ||
| [string]$Configuration | ||
| ) | ||
|
|
||
| # Calculate the fully qualified project name | ||
| if ($Project -eq "Riverside.Extensions.WinUI") { | ||
| $FullyQualifiedName = "Riverside.Extensions.$Head" | ||
| } else { | ||
| $FullyQualifiedName = "$($Project -replace '\.Toolkit\.', ".Toolkit.$Head.")" | ||
| } | ||
|
|
||
| # Define the project directory | ||
| $ScriptDirectory = Split-Path -Parent $MyInvocation.MyCommand.Path | ||
| $ProjectRoot = Join-Path -Path $ScriptDirectory -ChildPath "..\.." | ||
| $ProjectDirectory = Join-Path -Path $ProjectRoot -ChildPath "src\platforms\$FullyQualifiedName" | ||
|
|
||
| # Check if the project directory exists | ||
| if (-Not (Test-Path -Path $ProjectDirectory)) { | ||
| Write-Output "Project directory '$ProjectDirectory' does not exist, skipping build." | ||
| exit 0 | ||
| } | ||
|
|
||
| msbuild $ProjectDirectory /t:Restore /p:Configuration=$Configuration | ||
| # Run MSBuild | ||
| msbuild $ProjectDirectory /t:Build /p:Configuration=$Configuration /p:Platform=x64 | ||
|
|
||
| # Return to the original location | ||
| Pop-Location |
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| name: CD | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| branches: | ||
| - main | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Publish | ||
| runs-on: windows-latest | ||
| environment: NuGet | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| configuration: [Release] | ||
| platform: [Any CPU] | ||
| env: | ||
| WORKING_DIR: ${{ github.workspace }} | ||
| SOLUTION_PATH: '${{ github.workspace }}\CubeKit.sln' | ||
| HEAD_PROJECTS_DIR: '${{ github.workspace }}\src\platforms' | ||
| HEAD_EXTENSIONS_DIR: '${{ github.workspace }}\src\extensions' | ||
| CONFIGURATION: ${{ matrix.configuration }} | ||
| ARCHITECTURE: ${{ matrix.platform }} | ||
|
|
||
| steps: | ||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup MSBuild | ||
| uses: microsoft/setup-msbuild@v2 | ||
| - name: Setup NuGet | ||
| uses: NuGet/setup-nuget@v2 | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 9.x | ||
|
|
||
| - name: Restore project | ||
| shell: pwsh | ||
| run: | | ||
| msbuild $env:SOLUTION_PATH ` | ||
| -t:Restore ` | ||
| -p:Platform=$env:ARCHITECTURE ` | ||
| -p:Configuration=$env:CONFIGURATION | ||
|
|
||
| - name: Build CubeKit | ||
| run: | | ||
| msbuild "$env:SOLUTION_PATH" ` | ||
| -t:Build ` | ||
| -p:Platform=$env:ARCHITECTURE ` | ||
| -p:Configuration=$env:CONFIGURATION | ||
|
|
||
| - name: Package CubeKit | ||
| run: dotnet pack ${{ env.PACKAGE_PROJECT_PATH }} --configuration Release --no-build -o ./output | ||
|
|
||
| - name: Publish package to NuGet | ||
| run: dotnet nuget push ./output/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json | ||
| # TODO: Publish symbols as well | ||
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,107 @@ | ||
| name: CI | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| paths-ignore: | ||
| - '*.md' | ||
| pull_request: | ||
| paths-ignore: | ||
| - '*.md' | ||
|
|
||
| # The run name, either 'CubeKit PR Validation' if via a PR, or just 'CubeKit CI' if activated another way. | ||
| run-name: ${{ github.event_name == 'pull_request' && 'CubeKit PR Validation' || 'CubeKit CI' }} | ||
|
|
||
| # Environment variables. No values should be hardcoded, they should all be accessible as an environment variable. | ||
| env: | ||
| # MSBuild file locations | ||
| WORKING_DIR: ${{ github.workspace }} | ||
| SOLUTION_PATH: '${{ github.workspace }}\CubeKit.sln' | ||
| HEAD_PROJECTS_DIR: '${{ github.workspace }}\src\platforms' | ||
| HEAD_EXTENSIONS_DIR: '${{ github.workspace }}\src\extensions' | ||
| # Build configurations and tests | ||
| AUTOMATED_TESTS_ARCHITECTURE: 'x64' | ||
| AUTOMATED_TESTS_CONFIGURATION: 'Release' | ||
| # AUTOMATED_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests' | ||
| # AUTOMATED_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj' | ||
| # AUTOMATED_TESTS_ASSEMBLY_DIR: '${{ github.workspace }}\artifacts\TestsAssembly' | ||
| ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' | ||
|
|
||
| # Runner jobs | ||
| jobs: | ||
| # This is a simple workflow that checks the formatting of XAML. | ||
| # XAML is not used in many places in CubeKit, but ensuring that | ||
| # it is formatted is imperative nonetheless. | ||
| # TODO: Migrate this to a separate workflow in another repository | ||
| check-formatting: | ||
| name: Check Formatting | ||
|
|
||
| if: github.repository_owner == 'RiversideValley' | ||
|
|
||
| runs-on: windows-latest | ||
|
|
||
| steps: | ||
|
|
||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 2 | ||
| - name: Setup .NET 8 | ||
| uses: actions/setup-dotnet@v4 | ||
|
|
||
| - name: Install XamlStyler.Console | ||
| run: 'dotnet tool install --global XamlStyler.Console' | ||
|
|
||
| - name: Check XAML formatting | ||
| id: check-step | ||
| run: | | ||
| $changedFiles = (git diff --diff-filter=d --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} | ||
| foreach ($file in $changedFiles) | ||
| { | ||
| xstyler -p -l None -f $file | ||
| if ($LASTEXITCODE -ne 0) | ||
| { | ||
| echo "::error file=$file::Format check failed" | ||
| } | ||
| } | ||
| continue-on-error: true | ||
|
|
||
| - name: Fail if necessary | ||
| if: steps.check-step.outcome == 'failure' | ||
| run: exit 1 | ||
|
|
||
| build: | ||
| name: Build | ||
|
|
||
| if: github.repository_owner == 'RiversideValley' | ||
|
|
||
| runs-on: windows-latest | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| configuration: [Debug, Release] | ||
| core: [Riverside.Extensions.WinUI, Riverside.Toolkit.Animations, Riverside.Toolkit.Brushes, Riverside.Toolkit.Controls.Primitives, Riverside.Toolkit.Controls.TitleBar, Riverside.Toolkit.Converters, Riverside.Toolkit.Extensions, Riverside.Toolkit.Helpers, Riverside.Toolkit.Icons, Riverside.Toolkit.Services] | ||
| head: [Uno, Wpf, WinUI, Uwp] | ||
|
|
||
| env: | ||
| PROJECT: ${{ matrix.core }} | ||
| HEAD: ${{ matrix.head }} | ||
| CONFIGURATION: ${{ matrix.configuration }} | ||
|
|
||
| steps: | ||
|
|
||
| - name: Checkout the repository | ||
| uses: actions/checkout@v4 | ||
| - name: Setup MSBuild | ||
| uses: microsoft/setup-msbuild@v2 | ||
| - name: Setup NuGet | ||
| uses: NuGet/setup-nuget@v2 | ||
| - name: Setup .NET | ||
| uses: actions/setup-dotnet@v4 | ||
| with: | ||
| dotnet-version: 9.x | ||
|
|
||
| - name: Build project | ||
| shell: pwsh | ||
| run: '.github\scripts\BuildProject.ps1 -Project $env:PROJECT -Head $env:HEAD -Configuration $env:CONFIGURATION' |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.