-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
GitHub: Added build CI #13620
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
GitHub: Added build CI #13620
Changes from all commits
Commits
Show all changes
87 commits
Select commit
Hold shift + click to select a range
eea0fb2
GitHub: Preview deploy action
yaira2 6d050f8
Add build CI
0x5bfa 479f3b5
Update
0x5bfa a73693d
Update build-dev.yml
0x5bfa 177ac00
Update
0x5bfa 5cf469c
Fix
0x5bfa 4b9cfeb
Update
0x5bfa bb5689e
Fix
0x5bfa 038248c
Update
0x5bfa 7e52558
Fix
0x5bfa 1476a72
Update
0x5bfa 8ab0a44
Update
0x5bfa c9d8b7b
Update
0x5bfa f9a00f5
Update
0x5bfa 73a879a
Update
0x5bfa 2abe1eb
Fix
0x5bfa 182e84d
Update
0x5bfa 2da0d28
Update
0x5bfa ed0dda7
Update
0x5bfa e0ad035
Update
0x5bfa 9aac979
Update
0x5bfa ba86aef
Update
0x5bfa 1b72a15
Update
0x5bfa e159d2f
Update
0x5bfa 094ba03
Update
0x5bfa 0e9a22b
Update
0x5bfa 7888074
Update
0x5bfa 0599c20
Update actions to start WinAppDriver, add second app id to find app
marcelwgn 7a351d2
Delete builds/azure-pipelines.yml
0x5bfa bb9ba6e
Update and rename build-app.yml to ci.yml
0x5bfa 3b375e4
Merge branch 'main' into 5bfa/Add-DevCIActions
0x5bfa 190c288
Merge branch 'main' into 5bfa/Add-DevCIActions
0x5bfa 30ef09b
Update .github/workflows/ci.yml
0x5bfa ff3291e
Update
0x5bfa f9c8c1d
Update
0x5bfa 4c12684
Update
0x5bfa 3e7222b
Update
0x5bfa f53d75e
Fix if statement
0x5bfa 81eef00
Update
0x5bfa f371ff0
Updated
0x5bfa 32a292b
Update
0x5bfa 91bdbd7
Update
0x5bfa 0b4f060
Update
0x5bfa fe2f5ab
Update
0x5bfa ed95c75
Update
0x5bfa 98a14b2
Update
0x5bfa f4a8293
Update
0x5bfa 962c15f
Update ci.yml
0x5bfa fe74185
Update ci.yml
0x5bfa 2134186
Update
0x5bfa 8dc815d
Update to run WinAppDriver :(
0x5bfa d6782a3
Update
0x5bfa 64acb6d
Update
0x5bfa 28f1595
Update
0x5bfa 7182f95
Fix
0x5bfa 0b89262
Fix
0x5bfa 468c647
Update
0x5bfa a296850
Update
0x5bfa 384624f
Update Convert-TrxToMarkdown.ps1
0x5bfa f92cccb
Update ci.yml
0x5bfa 822fd93
Update
0x5bfa f28680e
merge
0x5bfa 00cb8f0
Done
0x5bfa 04b0754
Remove annotations
0x5bfa a8bcb29
Supress warnings
0x5bfa cb35cbd
Remove annotations 2
0x5bfa 6d627b0
Fix conditional job running
0x5bfa 87494dc
Update
0x5bfa 320d6fe
Fixed tool name
0x5bfa b675fc8
Update
0x5bfa a9ed8dc
Fix
0x5bfa b8e730c
Update
0x5bfa 2405f72
Fix
0x5bfa 69f6003
Update
0x5bfa 10b0f80
Update
0x5bfa ed3b54e
Switch to self sign script
marcelwgn a603ea4
Add additional app identity
marcelwgn 53e441c
Delete .github/workflows/check-xaml-formatting.yml
0x5bfa 35b26e9
Update ci.yml
0x5bfa d5ec8d6
Update
0x5bfa d2f87ad
Update
0x5bfa 184d1dd
Updated
0x5bfa 8a406d2
Update
0x5bfa ad1a7b1
Fix
0x5bfa 3684adf
Update SessionManager.cs
0x5bfa 14b45b6
Update SessionManager.cs
0x5bfa 92e632b
Update SessionManager.cs
0x5bfa 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 was deleted.
Oops, something went wrong.
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,241 @@ | ||
# Copyright (c) 2023 Files Community | ||
# Licensed under the MIT License. See the LICENSE. | ||
|
||
# Abstract: | ||
# - This CI is executed when a new commit is created on the main branch or | ||
# on a PR whose head branch is the main branch. | ||
# - However, the CI will not be executed if files not directly related to | ||
# source code maintenance are updated. | ||
|
||
name: Files CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'specs/**' | ||
- '*.md' | ||
pull_request: | ||
paths-ignore: | ||
- 'specs/**' | ||
- '*.md' | ||
|
||
run-name: ${{ github.event_name == 'pull_request' && 'Files PR Validation' || 'Files CI Validation' }} | ||
|
||
env: | ||
WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' | ||
SOLUTION_PATH: '${{ github.workspace }}\Files.sln' | ||
PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\Files.App (Package)' | ||
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj' | ||
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' | ||
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' | ||
APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\.github\workflows\FilesApp_SelfSigned.pfx' | ||
WINAPPDRIVER_EXE86_PATH: 'C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe' | ||
WINAPPDRIVER_EXE64_PATH: 'C:\Program Files\Windows Application Driver\WinAppDriver.exe' | ||
|
||
jobs: | ||
|
||
check-formatting: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
steps: | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Install XamlStyler console | ||
run: 'dotnet tool install --global XamlStyler.Console' | ||
|
||
- name: Check XAML formatting | ||
id: check-step | ||
run: | | ||
$changedFiles = (git diff --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 the job if the XamlStyler found unformatted file(s) | ||
if: steps.check-step.outcome == 'failure' | ||
run: exit 1 | ||
|
||
build: | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [Debug, Release] | ||
platform: [x64, arm64] | ||
env: | ||
CONFIGURATION: ${{ matrix.configuration }} | ||
ARCHITECTURE: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup MSBuild | ||
uses: microsoft/setup-msbuild@v1 | ||
|
||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v1.1.1 | ||
|
||
- name: Setup .NET 7 | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: '7.0.x' | ||
|
||
- name: Restore NuGet | ||
shell: pwsh | ||
run: 'nuget restore $env:SOLUTION_PATH' | ||
|
||
- name: Restore Files | ||
shell: pwsh | ||
run: | | ||
msbuild $env:SOLUTION_PATH ` | ||
-t:Restore ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:PublishReadyToRun=true | ||
|
||
- if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION || env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE | ||
name: Build Files | ||
run: | | ||
msbuild ` | ||
$env:PACKAGE_PROJECT_PATH ` | ||
-t:Build ` | ||
-clp:ErrorsOnly ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:AppxBundle=Never | ||
|
||
- if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE | ||
name: Create self signed cert as a pfx file | ||
run: ./scripts/Generate-SelfCertPfx.ps1 -Destination "$env:APPX_SELFSIGNED_CERT_PATH" | ||
|
||
- if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE | ||
name: Build & package Files | ||
run: | | ||
msbuild ` | ||
$env:PACKAGE_PROJECT_PATH ` | ||
-t:Build ` | ||
-t:_GenerateAppxPackage ` | ||
-clp:ErrorsOnly ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:AppxBundlePlatforms=$env:AUTOMATED_TESTS_ARCHITECTURE ` | ||
-p:AppxBundle=Always ` | ||
-p:UapAppxPackageBuildMode=SideloadOnly ` | ||
-p:AppxPackageDir=$env:APPX_PACKAGE_DIR ` | ||
-p:AppxPackageSigningEnabled=true ` | ||
-p:PackageCertificateKeyFile=$env:APPX_SELFSIGNED_CERT_PATH ` | ||
-p:PackageCertificatePassword="" ` | ||
-p:PackageCertificateThumbprint="" | ||
|
||
- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION | ||
name: Build interaction tests | ||
run: | | ||
msbuild $env:AUTOMATED_TESTS_PROJECT_PATH ` | ||
-t:Build ` | ||
-clp:ErrorsOnly ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE | ||
|
||
- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION | ||
name: Copy tests bin to the artifacts dir | ||
shell: pwsh | ||
run: | | ||
Copy-Item ` | ||
-Path "$env:AUTOMATED_TESTS_PROJECT_DIR\bin" ` | ||
-Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR" -Recurse | ||
|
||
- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION | ||
name: Upload the packages to the Artifacts | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})' | ||
path: ${{ env.ARTIFACTS_STAGING_DIR }} | ||
|
||
test: | ||
needs: [build] | ||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [Release] | ||
platform: [x64] | ||
yaira2 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
env: | ||
CONFIGURATION: ${{ matrix.configuration }} | ||
permissions: | ||
contents: read | ||
pull-requests: write | ||
|
||
steps: | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Download the packages from the Artifacts | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.AUTOMATED_TESTS_ARCHITECTURE }})' | ||
path: ${{ env.ARTIFACTS_STAGING_DIR }} | ||
|
||
- name: Install Files | ||
shell: powershell | ||
run: | | ||
Set-Location "$env:APPX_PACKAGE_DIR" | ||
$AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name | ||
Set-Location $AppxPackageBundleDir | ||
./Install.ps1 -Force | ||
Get-AppxPackage | ||
|
||
- name: Set full HD resolution | ||
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force | ||
|
||
- name: Start WinAppDriver process | ||
shell: pwsh | ||
run: Start-Process -FilePath "$env:WINAPPDRIVER_EXE86_PATH" | ||
|
||
- name: Run interaction tests | ||
run: | | ||
dotnet test ` | ||
$env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll ` | ||
--logger "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" | ||
|
||
# - name: Generate markdown from the tests result | ||
# shell: pwsh | ||
# run: | | ||
# . './scripts/Convert-TrxToMarkdown.ps1' ` | ||
# -Source "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" ` | ||
# -Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md" | ||
# env: | ||
# PULL_REQUEST_ID: ${{ github.event.pull_request_id }} | ||
|
||
# - name: Display the markdown on the output (temp) | ||
# shell: pwsh | ||
# run: | | ||
# Get-Content $env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md | ||
|
||
# - name: Publish tests result | ||
# uses: marocchino/sticky-pull-request-comment@v2 | ||
# with: | ||
# header: test-result | ||
# path: '${{ env.AUTOMATED_TESTS_ASSEMBLY_DIR }}\testResults.md' |
Binary file not shown.
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.