From eea0fb25d3621dde68bb002bf02dd2c3bbea2676 Mon Sep 17 00:00:00 2001 From: Yair <39923744+yaira2@users.noreply.github.com> Date: Mon, 30 Oct 2023 12:33:10 -0400 Subject: [PATCH 01/84] GitHub: Preview deploy action --- .github/workflows/deploy-preview.yml | 155 ++++++++++++++++++ src/Files.App (Package)/Files.Package.wapproj | 5 + src/Files.App/Files.App.csproj | 1 - src/Files.App/Helpers/LocationHelpers.cs | 7 +- src/Files.App/Resources/BingMapsKey.txt | 1 - 5 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/deploy-preview.yml delete mode 100644 src/Files.App/Resources/BingMapsKey.txt diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml new file mode 100644 index 000000000000..18a8c54ca364 --- /dev/null +++ b/.github/workflows/deploy-preview.yml @@ -0,0 +1,155 @@ +name: Deploy Preview Pipeline + +on: + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + environment: Deployments + strategy: + fail-fast: false + matrix: + configuration: [Preview] + platform: [x64] + env: + SOLUTION_NAME: 'Files.sln' + PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' + PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' + TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + CONFIGURATION: ${{ matrix.configuration }} + PLATFORM: ${{ matrix.platform }} + APPX_BUNDLE_PLATFORMS: 'x64|arm64' + WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ + ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts + APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages + + 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' + + # TODO: Move the command to PowerShell script instead + - name: Update Package.appxmanifest + shell: pwsh + run: | + [xml]$xmlDoc = Get-Content "$env:PACKAGE_PROJECT_DIR\Package.appxmanifest" + $xmlDoc.Package.Identity.Name="FilesPreview" + $xmlDoc.Package.Identity.Publisher="$env:SIDELOAD_PUBLISHER_SECRET" + $xmlDoc.Package.Properties.DisplayName="Files - Preview" + $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files - Preview" + $xmlDoc.Save("$env:PACKAGE_PROJECT_DIR\Package.appxmanifest") + env: + SIDELOAD_PUBLISHER_SECRET: ${{ secrets.SIDELOAD_PUBLISHER_SECRET }} + + # TODO: Move the command to PowerShell script instead + - name: Use the ${{ env.CONFIGURATION }} logo sets + shell: pwsh + run: | + Get-ChildItem "$env:WORKING_DIR\src" -Include *.csproj, *.appxmanifest, *.wapproj, *.xaml -recurse | ForEach -Process ` + { ` + (Get-Content $_ -Raw | ForEach -Process { $_ -replace "Assets\\AppTiles\\Dev", "Assets\AppTiles\Preview" }) | ` + Set-Content $_ -NoNewline ` + } + + - name: Inject the Bing Maps API token + shell: pwsh + run: | + Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process ` + { ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "bingmapskey.secret", "$env:BING_MAPS_SECRET" }) | ` + Set-Content $_ -NoNewline ` + } + env: + BING_MAPS_SECRET: ${{ secrets.BING_MAPS_SECRET }} + + - name: Inject the AppCenter token + shell: pwsh + run: | + Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process ` + { ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "appcenter.secret", "$env:APP_CENTER_SECRET" }) | ` + Set-Content $_ -NoNewline ` + } + env: + APP_CENTER_SECRET: ${{ secrets.APP_CENTER_SECRET }} + + - name: Inject the GitHub OAuth client ID + run: | + Get-ChildItem "$env:WORKING_DIR\src" -Include *.cs -recurse | ForEach-Object -Process ` + { ` + (Get-Content $_ -Raw | ForEach-Object -Process { $_ -replace "githubclientid.secret", "$env:GH_OAUTH_CLIENT_ID" }) | ` + Set-Content $_ -NoNewline ` + } + env: + GH_OAUTH_CLIENT_ID: ${{ secrets.GH_OAUTH_CLIENT_ID }} + + - name: Use Windows SDK Preview + shell: cmd + run: | + for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt + + - name: Restore NuGet + shell: pwsh + run: 'nuget restore $env:SOLUTION_NAME' + + - name: Restore ${{ env.SOLUTION_NAME }} + shell: pwsh + run: | + msbuild $env:SOLUTION_NAME ` + -t:Restore ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION ` + -p:PublishReadyToRun=true + + - name: Build ${{ env.SOLUTION_NAME }} + shell: pwsh + run: | + msbuild "$env:PACKAGE_PROJECT_PATH" ` + -t:Build ` + -t:_GenerateAppxPackage ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION ` + -p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` + -p:AppxPackageDir="$env:APPX_PACKAGE_DIR" ` + -p:AppxBundle=Always ` + -p:UapAppxPackageBuildMode=Sideload ` + -p:GenerateAppInstallerFile=True ` + -p:AppInstallerUri=https://cdn.files.community/files/preview/ + + - name: Remove empty files from the packages + shell: bash + run: find $ARTIFACTS_STAGING_DIR -empty -delete + + - name: Sign files with Azure Code Signing + uses: azure/azure-code-signing-action@v0.2.21 + with: + azure-tenant-id: ${{ secrets.AZURE_TENANT_ID }} + azure-client-id: ${{ secrets.AZURE_CLIENT_ID }} + azure-client-secret: ${{ secrets.AZURE_CLIENT_SECRET }} + endpoint: https://wus2.codesigning.azure.net/ + code-signing-account-name: ${{ secrets.SIGNING_ACCOUNT_NAME }} + certificate-profile-name: ${{ secrets.SIGNING_PROFILE_NAME }} + files-folder: ${{ env.APPX_PACKAGE_DIR }} + files-folder-filter: msixbundle + files-folder-recurse: true + files-folder-depth: 4 + file-digest: SHA256 + timestamp-rfc3161: http://timestamp.acs.microsoft.com + timestamp-digest: SHA256 + + - name: Upload the packages to GitHub Actions + uses: actions/upload-artifact@v3 + with: + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})' + path: ${{ env.ARTIFACTS_STAGING_DIR }} diff --git a/src/Files.App (Package)/Files.Package.wapproj b/src/Files.App (Package)/Files.Package.wapproj index cf19099b5c60..b740fd743bdf 100644 --- a/src/Files.App (Package)/Files.Package.wapproj +++ b/src/Files.App (Package)/Files.Package.wapproj @@ -85,11 +85,14 @@ x86 + $(MSBuildExtensionsPath)\Microsoft\DesktopBridge\ Files.App\ + + Designer @@ -97,12 +100,14 @@ + True Properties\PublishProfiles\win10-$(Platform).pubxml + diff --git a/src/Files.App/Files.App.csproj b/src/Files.App/Files.App.csproj index 55a5af70f616..e00755f3b88d 100644 --- a/src/Files.App/Files.App.csproj +++ b/src/Files.App/Files.App.csproj @@ -49,7 +49,6 @@ NOTICE.md PreserveNewest - PreserveNewest diff --git a/src/Files.App/Helpers/LocationHelpers.cs b/src/Files.App/Helpers/LocationHelpers.cs index 862a6be32fb1..189d11cf0c62 100644 --- a/src/Files.App/Helpers/LocationHelpers.cs +++ b/src/Files.App/Helpers/LocationHelpers.cs @@ -1,10 +1,8 @@ // Copyright(c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. -using System.Text.Json; using Windows.Devices.Geolocation; using Windows.Services.Maps; -using Windows.Storage; namespace Files.App.Helpers { @@ -19,10 +17,7 @@ public static async Task GetAddressFromCoordinatesAsync(double? Lat, dou { try { - StorageFile file = await StorageFile.GetFileFromApplicationUriAsync(new Uri(@"ms-appx:///Resources/BingMapsKey.txt")); - var lines = await FileIO.ReadTextAsync(file); - using var obj = JsonDocument.Parse(lines); - MapService.ServiceToken = obj.RootElement.GetProperty("key").GetString(); + MapService.ServiceToken = "bingmapskey.secret"; } catch (Exception) { diff --git a/src/Files.App/Resources/BingMapsKey.txt b/src/Files.App/Resources/BingMapsKey.txt deleted file mode 100644 index 5f282702bb03..000000000000 --- a/src/Files.App/Resources/BingMapsKey.txt +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file From 6d050f82137f86acd55c2f4164223775842dab84 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 31 Oct 2023 04:12:55 +0000 Subject: [PATCH 02/84] Add build CI --- .github/workflows/build-dev.yml | 60 +++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build-dev.yml diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml new file mode 100644 index 000000000000..ca986812a5e4 --- /dev/null +++ b/.github/workflows/build-dev.yml @@ -0,0 +1,60 @@ +name: Build Dev Pipeline + +on: + workflow_dispatch: + +jobs: + build: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + configuration: [Dev] + platform: [x64, arm64] + env: + SOLUTION_NAME: 'Files.sln' + PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' + PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' + TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + CONFIGURATION: ${{ matrix.configuration }} + PLATFORM: ${{ matrix.platform }} + WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ + + 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_NAME' + + - name: Restore ${{ env.SOLUTION_NAME }} + shell: pwsh + run: | + msbuild $env:SOLUTION_NAME ` + -t:Restore ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION ` + -p:PublishReadyToRun=true + + - name: Build ${{ env.SOLUTION_NAME }} + shell: pwsh + run: | + msbuild "$env:PACKAGE_PROJECT_PATH" ` + -t:Build ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION ` + -p:AppxBundle=Never + +# TODO: Add tests running \ No newline at end of file From 479f3b56267d5481d1a9f8f3de3da481f0d123de Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 31 Oct 2023 04:18:28 +0000 Subject: [PATCH 03/84] Update --- .github/workflows/build-dev.yml | 11 ++++++++++- builds/azure-pipelines.yml | 8 +++++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index ca986812a5e4..3f79367772ed 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -1,7 +1,16 @@ name: Build Dev Pipeline on: - workflow_dispatch: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' jobs: build: diff --git a/builds/azure-pipelines.yml b/builds/azure-pipelines.yml index d117f2d60c12..7a4a11b00f97 100644 --- a/builds/azure-pipelines.yml +++ b/builds/azure-pipelines.yml @@ -1,5 +1,11 @@ trigger: -- main + branches: + include: + - main + paths: + exclude: + - 'docs/**' + - '*.md' pool: vmImage: 'windows-latest' From a73693d097c2df086f4c437cba3fd41ff03e1e2d Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 31 Oct 2023 16:02:26 +0900 Subject: [PATCH 04/84] Update build-dev.yml --- .github/workflows/build-dev.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml index 3f79367772ed..8faf4e83a083 100644 --- a/.github/workflows/build-dev.yml +++ b/.github/workflows/build-dev.yml @@ -18,7 +18,7 @@ jobs: strategy: fail-fast: false matrix: - configuration: [Dev] + configuration: [Debug] platform: [x64, arm64] env: SOLUTION_NAME: 'Files.sln' @@ -66,4 +66,4 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:AppxBundle=Never -# TODO: Add tests running \ No newline at end of file +# TODO: Add tests running From 177ac000ce09b315c04642cd653a0e4bd04aac17 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 05:33:16 +0000 Subject: [PATCH 05/84] Update --- .github/workflows/build-app.yml | 91 +++++++++++++++++++++++++++++++++ .github/workflows/build-dev.yml | 69 ------------------------- builds/azure-pipelines.yml | 1 + 3 files changed, 92 insertions(+), 69 deletions(-) create mode 100644 .github/workflows/build-app.yml delete mode 100644 .github/workflows/build-dev.yml diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml new file mode 100644 index 000000000000..57eaedfef09e --- /dev/null +++ b/.github/workflows/build-app.yml @@ -0,0 +1,91 @@ +name: Build Files + +on: + push: + branches: + - main + paths-ignore: + - 'docs/**' + - '*.md' + pull_request: + paths-ignore: + - 'docs/**' + - '*.md' + +env: + APPLICATION_NAME: 'Files' + SOLUTION_NAME: 'Files.sln' + PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' + PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' + TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + CONFIGURATION: ${{ matrix.configuration }} + PLATFORM: ${{ matrix.platform }} + APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} + WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ + ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts + APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages + +jobs: + build: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + configuration: [Debug] + platform: [x64, arm64] + + 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_NAME' + + - name: Restore ${{ env.APPLICATION_NAME }} + shell: pwsh + run: | + msbuild $env:SOLUTION_NAME ` + -t:Restore ` + -p:Platform=$env:PLATFORM ` + -p:Configuration=$env:CONFIGURATION ` + -p:PublishReadyToRun=true + + - name: Build & Publish ${{ env.APPLICATION_NAME }} + run: | + msbuild + -p:Configuration=$env:CONFIGURATION ` + -p:Platform=$env:PLATFORM ` + -p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` + -p:AppxBundle=Always ` + -p:UapAppxPackageBuildMode=SideloadOnly ` + -p:AppxPackageDir=$env:APPX_PACKAGE_DIR ` + -p:AppxPackageSigningEnabled=true + + - name: Install package + shell: pwsh + run: | + cd "$env:APPX_PACKAGE_DIR" + $AppBundle = Get-ChildItem -Filter Files*Test -Name + echo $AppBundle + cd $AppBundle + ls + ./Install.ps1 -Force + Get-AppxPackage + + - name: Set full HD resolution + run: Set-DisplayResolution -Width 1920 -Height 1080 -Force + + - name: Execute UI tests + run: dotnet test diff --git a/.github/workflows/build-dev.yml b/.github/workflows/build-dev.yml deleted file mode 100644 index 8faf4e83a083..000000000000 --- a/.github/workflows/build-dev.yml +++ /dev/null @@ -1,69 +0,0 @@ -name: Build Dev Pipeline - -on: - push: - branches: - - main - paths-ignore: - - 'docs/**' - - '*.md' - pull_request: - paths-ignore: - - 'docs/**' - - '*.md' - -jobs: - build: - runs-on: windows-latest - strategy: - fail-fast: false - matrix: - configuration: [Debug] - platform: [x64, arm64] - env: - SOLUTION_NAME: 'Files.sln' - PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' - PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' - TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' - CONFIGURATION: ${{ matrix.configuration }} - PLATFORM: ${{ matrix.platform }} - WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ - - 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_NAME' - - - name: Restore ${{ env.SOLUTION_NAME }} - shell: pwsh - run: | - msbuild $env:SOLUTION_NAME ` - -t:Restore ` - -p:Platform=$env:PLATFORM ` - -p:Configuration=$env:CONFIGURATION ` - -p:PublishReadyToRun=true - - - name: Build ${{ env.SOLUTION_NAME }} - shell: pwsh - run: | - msbuild "$env:PACKAGE_PROJECT_PATH" ` - -t:Build ` - -p:Platform=$env:PLATFORM ` - -p:Configuration=$env:CONFIGURATION ` - -p:AppxBundle=Never - -# TODO: Add tests running diff --git a/builds/azure-pipelines.yml b/builds/azure-pipelines.yml index 7a4a11b00f97..a7cd5f7d1cb9 100644 --- a/builds/azure-pipelines.yml +++ b/builds/azure-pipelines.yml @@ -4,6 +4,7 @@ trigger: - main paths: exclude: + - '.github/**' - 'docs/**' - '*.md' From 5cf469ceefd25ace3c836c3846973e6495077f94 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 05:34:28 +0000 Subject: [PATCH 06/84] Fix --- .github/workflows/build-app.yml | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 57eaedfef09e..297b1200d095 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -12,27 +12,26 @@ on: - 'docs/**' - '*.md' -env: - APPLICATION_NAME: 'Files' - SOLUTION_NAME: 'Files.sln' - PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' - PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' - TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' - CONFIGURATION: ${{ matrix.configuration }} - PLATFORM: ${{ matrix.platform }} - APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} - WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ - ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts - APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages - jobs: - build: + build-test: runs-on: windows-latest strategy: fail-fast: false matrix: configuration: [Debug] platform: [x64, arm64] + env: + APPLICATION_NAME: 'Files' + SOLUTION_NAME: 'Files.sln' + PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' + PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' + TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + CONFIGURATION: ${{ matrix.configuration }} + PLATFORM: ${{ matrix.platform }} + APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} + WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ + ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts + APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages steps: - name: Checkout the repository From 4b9cfebf953d117029bf6d7b1d70432ad24d4003 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 06:02:53 +0000 Subject: [PATCH 07/84] Update --- .github/workflows/build-app.yml | 53 +++++++++++++++++++++++++-------- 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 297b1200d095..1ff05bdaa2ab 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -12,8 +12,18 @@ on: - 'docs/**' - '*.md' +env: + APPLICATION_NAME: 'Files' + SOLUTION_NAME: 'Files.sln' + PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' + PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' + TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ + ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts + APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages + jobs: - build-test: + build: runs-on: windows-latest strategy: fail-fast: false @@ -21,17 +31,9 @@ jobs: configuration: [Debug] platform: [x64, arm64] env: - APPLICATION_NAME: 'Files' - SOLUTION_NAME: 'Files.sln' - PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' - PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' - TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' CONFIGURATION: ${{ matrix.configuration }} PLATFORM: ${{ matrix.platform }} APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} - WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ - ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts - APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages steps: - name: Checkout the repository @@ -52,7 +54,7 @@ jobs: shell: pwsh run: 'nuget restore $env:SOLUTION_NAME' - - name: Restore ${{ env.APPLICATION_NAME }} + - name: Restore Files shell: pwsh run: | msbuild $env:SOLUTION_NAME ` @@ -61,9 +63,11 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true - - name: Build & Publish ${{ env.APPLICATION_NAME }} + - name: Build & Publish Files run: | - msbuild + msbuild $env:SOLUTION_NAME ` + -t:Build ` + -t:_GenerateAppxPackage ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:PLATFORM ` -p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` @@ -72,6 +76,31 @@ jobs: -p:AppxPackageDir=$env:APPX_PACKAGE_DIR ` -p:AppxPackageSigningEnabled=true + - name: Upload the packages to GitHub Actions + uses: actions/upload-artifact@v3 + with: + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})' + path: ${{ env.ARTIFACTS_STAGING_DIR }} + + test: + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + configuration: [Debug] + platform: [x64, arm64] + env: + CONFIGURATION: ${{ matrix.configuration }} + PLATFORM: ${{ matrix.platform }} + APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} + + steps: + + - uses: actions/download-artifact@v3 + with: + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})' + path: ${{ env.APPX_PACKAGE_DIR }} + - name: Install package shell: pwsh run: | From bb5689ef0685f0c1e3cdc9d0d6118cf4f2ec6eb1 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 06:16:10 +0000 Subject: [PATCH 08/84] Fix --- .github/workflows/build-app.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 1ff05bdaa2ab..c5cea40af12a 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -83,6 +83,7 @@ jobs: path: ${{ env.ARTIFACTS_STAGING_DIR }} test: + needs: [build] runs-on: windows-latest strategy: fail-fast: false From 038248c92dcf573f93cafe8327b455b4791a5544 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 06:23:05 +0000 Subject: [PATCH 09/84] Update --- .github/workflows/build-app.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index c5cea40af12a..a3ce9ad65691 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -18,9 +18,10 @@ env: PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' - WORKING_DIR: ${{ github.workspace }} # Default: D:\a\Files\Files\ + WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages + APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\builds\Files_SelfSigned.pfx' jobs: build: @@ -74,7 +75,10 @@ jobs: -p:AppxBundle=Always ` -p:UapAppxPackageBuildMode=SideloadOnly ` -p:AppxPackageDir=$env:APPX_PACKAGE_DIR ` - -p:AppxPackageSigningEnabled=true + -p:AppxPackageSigningEnabled=true ` + -p:PackageCertificateKeyFile=$env:APPX_SELFSIGNED_CERT_PATH ` + -p:PackageCertificatePassword="" ` + -p:PackageCertificateThumbprint="" - name: Upload the packages to GitHub Actions uses: actions/upload-artifact@v3 From 7e525580f43e96ed06aba545925c9701d17e99bf Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 06:43:50 +0000 Subject: [PATCH 10/84] Fix --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index a3ce9ad65691..f0293cf70518 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -66,7 +66,7 @@ jobs: - name: Build & Publish Files run: | - msbuild $env:SOLUTION_NAME ` + msbuild $env:PACKAGE_PROJECT_PATH ` -t:Build ` -t:_GenerateAppxPackage ` -p:Configuration=$env:CONFIGURATION ` From 1476a7268318ed118d745bffa4b1cd0a59480c5d Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:03:15 +0000 Subject: [PATCH 11/84] Update --- .github/workflows/build-app.yml | 49 +++++++++++++++++++++------------ 1 file changed, 32 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index f0293cf70518..d0220a60d7c2 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -1,4 +1,11 @@ -name: Build Files +# Copyright (c) 2023 Files Community +# Licensed under the MIT License. See the LICENSE. + +# Abstract: +# This CI is triggered when a commit was added in the main branch directly or +# a commit was added in a PR whose base branch is the main branch within this repository. + +name: Build & test Files on: push: @@ -15,6 +22,7 @@ on: env: APPLICATION_NAME: 'Files' SOLUTION_NAME: 'Files.sln' + PRIMARY_ARCHITECTURE: 'x64' PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' @@ -33,8 +41,7 @@ jobs: platform: [x64, arm64] env: CONFIGURATION: ${{ matrix.configuration }} - PLATFORM: ${{ matrix.platform }} - APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} + ARCHITECTURE: ${{ matrix.platform }} steps: - name: Checkout the repository @@ -60,18 +67,28 @@ jobs: run: | msbuild $env:SOLUTION_NAME ` -t:Restore ` - -p:Platform=$env:PLATFORM ` + -p:Platform=$env:ARCHITECTURE ` -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true - - name: Build & Publish Files + - if: env.ARCHITECTURE != env.PRIMARY_ARCHITECTURE + name: Build Files + run: | + msbuild $env:PACKAGE_PROJECT_PATH ` + -t:Build ` + -p:Configuration=$env:CONFIGURATION ` + -p:Platform=$env:ARCHITECTURE ` + -p:AppxBundle=Never + + - if: env.ARCHITECTURE == env.PRIMARY_ARCHITECTURE + name: Build & Publish Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` -t:Build ` -t:_GenerateAppxPackage ` -p:Configuration=$env:CONFIGURATION ` - -p:Platform=$env:PLATFORM ` - -p:AppxBundlePlatforms=$env:APPX_BUNDLE_PLATFORMS ` + -p:Platform=$env:ARCHITECTURE ` + -p:AppxBundlePlatforms=$env:PRIMARY_ARCHITECTURE ` -p:AppxBundle=Always ` -p:UapAppxPackageBuildMode=SideloadOnly ` -p:AppxPackageDir=$env:APPX_PACKAGE_DIR ` @@ -80,10 +97,11 @@ jobs: -p:PackageCertificatePassword="" ` -p:PackageCertificateThumbprint="" - - name: Upload the packages to GitHub Actions + - if: env.ARCHITECTURE == env.PRIMARY_ARCHITECTURE + name: Upload the packages to GitHub Actions uses: actions/upload-artifact@v3 with: - name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})' + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PRIMARY_ARCHITECTURE }})' path: ${{ env.ARTIFACTS_STAGING_DIR }} test: @@ -93,26 +111,23 @@ jobs: fail-fast: false matrix: configuration: [Debug] - platform: [x64, arm64] env: CONFIGURATION: ${{ matrix.configuration }} - PLATFORM: ${{ matrix.platform }} - APPX_BUNDLE_PLATFORMS: ${{ matrix.platform }} steps: - uses: actions/download-artifact@v3 with: - name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PLATFORM }})' + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PRIMARY_ARCHITECTURE }})' path: ${{ env.APPX_PACKAGE_DIR }} - name: Install package shell: pwsh run: | cd "$env:APPX_PACKAGE_DIR" - $AppBundle = Get-ChildItem -Filter Files*Test -Name - echo $AppBundle - cd $AppBundle + $AppxPackageBundleDir = Get-ChildItem -Filter "Files.Package_*_$env:CONFIGURATION_Test" -Name + echo $AppxPackageBundleDir + cd $AppxPackageBundleDir ls ./Install.ps1 -Force Get-AppxPackage @@ -120,5 +135,5 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - - name: Execute UI tests + - name: Run UI tests run: dotnet test From 8ab0a44c724d80b5233e802efa18290a28925f36 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:25:57 +0000 Subject: [PATCH 12/84] Update --- .github/workflows/build-app.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index d0220a60d7c2..a789e58e4104 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -111,6 +111,7 @@ jobs: fail-fast: false matrix: configuration: [Debug] + platform: [x64] env: CONFIGURATION: ${{ matrix.configuration }} @@ -124,12 +125,22 @@ jobs: - name: Install package shell: pwsh run: | - cd "$env:APPX_PACKAGE_DIR" + # Go to generated appx packge dir + Set-Location "$env:APPX_PACKAGE_DIR" + + # Get bundle dir $AppxPackageBundleDir = Get-ChildItem -Filter "Files.Package_*_$env:CONFIGURATION_Test" -Name - echo $AppxPackageBundleDir - cd $AppxPackageBundleDir - ls + + Write-Output $AppxPackageBundleDir + + # Go to bundle dir + Set-Location $AppxPackageBundleDir + + Get-ChildItem + + # Install the package ./Install.ps1 -Force + Get-AppxPackage - name: Set full HD resolution From c9d8b7b268b066fa56a73b5a5da9ce486a266f0a Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:41:53 +0000 Subject: [PATCH 13/84] Update --- .github/workflows/build-app.yml | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index a789e58e4104..260709f0d7e5 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -125,22 +125,12 @@ jobs: - name: Install package shell: pwsh run: | - # Go to generated appx packge dir Set-Location "$env:APPX_PACKAGE_DIR" - - # Get bundle dir - $AppxPackageBundleDir = Get-ChildItem -Filter "Files.Package_*_$env:CONFIGURATION_Test" -Name - + $AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name Write-Output $AppxPackageBundleDir - - # Go to bundle dir Set-Location $AppxPackageBundleDir - Get-ChildItem - - # Install the package ./Install.ps1 -Force - Get-AppxPackage - name: Set full HD resolution From f9a00f5bab034389a70945452a48e86f1ddbb099 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 07:44:15 +0000 Subject: [PATCH 14/84] Update --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 260709f0d7e5..90332d309ff8 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -120,7 +120,7 @@ jobs: - uses: actions/download-artifact@v3 with: name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PRIMARY_ARCHITECTURE }})' - path: ${{ env.APPX_PACKAGE_DIR }} + path: ${{ env.ARTIFACTS_STAGING_DIR }} - name: Install package shell: pwsh From 73a879a978988ffe1e008b233248f32421ff6a23 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 08:00:45 +0000 Subject: [PATCH 15/84] Update --- .github/workflows/build-app.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 90332d309ff8..61c708922083 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -127,9 +127,8 @@ jobs: run: | Set-Location "$env:APPX_PACKAGE_DIR" $AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name - Write-Output $AppxPackageBundleDir Set-Location $AppxPackageBundleDir - Get-ChildItem + Import-Module Appx ./Install.ps1 -Force Get-AppxPackage From 2abe1ebac85aacddf06240c63d01f02f0f5e7777 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 08:15:45 +0000 Subject: [PATCH 16/84] Fix --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 61c708922083..c6a0aafee18c 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -128,7 +128,7 @@ jobs: Set-Location "$env:APPX_PACKAGE_DIR" $AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name Set-Location $AppxPackageBundleDir - Import-Module Appx + Import-Module Appx -UseWindowsPowerShell ./Install.ps1 -Force Get-AppxPackage From 182e84d0e7d71d9e5f9ed6ad29fca9d3b2f52746 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 08:52:17 +0000 Subject: [PATCH 17/84] Update --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index c6a0aafee18c..884e3fc54ab1 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -128,7 +128,7 @@ jobs: Set-Location "$env:APPX_PACKAGE_DIR" $AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name Set-Location $AppxPackageBundleDir - Import-Module Appx -UseWindowsPowerShell + Import-Module Appx -UseWindowsPowerShell -SkipEditionCheck ./Install.ps1 -Force Get-AppxPackage From 2da0d2816df61302f15027a23b9e718d4afee21f Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 21:00:32 +0900 Subject: [PATCH 18/84] Update --- .github/workflows/build-app.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 884e3fc54ab1..3e8fb964f0b8 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -123,12 +123,11 @@ jobs: path: ${{ env.ARTIFACTS_STAGING_DIR }} - name: Install package - shell: pwsh + shell: powershell run: | Set-Location "$env:APPX_PACKAGE_DIR" $AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name Set-Location $AppxPackageBundleDir - Import-Module Appx -UseWindowsPowerShell -SkipEditionCheck ./Install.ps1 -Force Get-AppxPackage From ed0dda782a3b82fb7ea54a8ef9157042f0d8c146 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 21:39:49 +0900 Subject: [PATCH 19/84] Update --- .github/workflows/build-app.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 3e8fb964f0b8..02c17c1019a0 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -25,7 +25,7 @@ env: PRIMARY_ARCHITECTURE: 'x64' PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' - TEST_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + INTERACTION_TESTS_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages @@ -135,4 +135,7 @@ jobs: run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - name: Run UI tests - run: dotnet test + run: | + dotnet test "$env:INTERACTION_TESTS_PROJECT_PATH" ` + -a $env:PRIMARY_ARCHITECTURE ` + -c $env:CONFIGURATION From e0ad035427ab43fdfe18096ad38207dd387b9aba Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:05:34 +0900 Subject: [PATCH 20/84] Update --- .github/workflows/build-app.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 02c17c1019a0..49d9044ed9cd 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -23,9 +23,10 @@ env: APPLICATION_NAME: 'Files' SOLUTION_NAME: 'Files.sln' PRIMARY_ARCHITECTURE: 'x64' - PACKAGE_PROJECT_DIR: 'src\Files.App (Package)' - PACKAGE_PROJECT_PATH: 'src\Files.App (Package)\Files.Package.wapproj' - INTERACTION_TESTS_PROJECT_PATH: 'tests\Files.InteractionTests\Files.InteractionTests.csproj' + 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' + INTERACTION_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj' WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages @@ -60,12 +61,12 @@ jobs: - name: Restore NuGet shell: pwsh - run: 'nuget restore $env:SOLUTION_NAME' + run: 'nuget restore $env:SOLUTION_PATH' - name: Restore Files shell: pwsh run: | - msbuild $env:SOLUTION_NAME ` + msbuild $env:SOLUTION_PATH ` -t:Restore ` -p:Platform=$env:ARCHITECTURE ` -p:Configuration=$env:CONFIGURATION ` From 9aac979ab67c343be7824dd9870e2a26d782e2f9 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:55:05 +0900 Subject: [PATCH 21/84] Update --- .github/workflows/build-app.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 49d9044ed9cd..ef770f68e1e4 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -26,6 +26,7 @@ env: 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' + INTERACTION_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests' INTERACTION_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj' WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts @@ -135,8 +136,13 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - - name: Run UI tests + - name: Build interaction tests + shell: pwsh + run: 'dotnet build $env:INTERACTION_TESTS_PROJECT_PATH' + + - name: Run interaction tests + shell: pwsh run: | - dotnet test "$env:INTERACTION_TESTS_PROJECT_PATH" ` + dotnet test $env:INTERACTION_TESTS_PROJECT_DIR\**\Files.InteractionTests.dll ` -a $env:PRIMARY_ARCHITECTURE ` -c $env:CONFIGURATION From ba86aef0ea0618842e5868167a8cbcdc3e546898 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 22:56:37 +0900 Subject: [PATCH 22/84] Update --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index ef770f68e1e4..0f87d8a46ea1 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -143,6 +143,6 @@ jobs: - name: Run interaction tests shell: pwsh run: | - dotnet test $env:INTERACTION_TESTS_PROJECT_DIR\**\Files.InteractionTests.dll ` + dotnet test $env:INTERACTION_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll ` -a $env:PRIMARY_ARCHITECTURE ` -c $env:CONFIGURATION From 1b72a1541c110816efa344e9592899ef673e5cb0 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 23:19:33 +0900 Subject: [PATCH 23/84] Update --- .github/workflows/build-app.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 0f87d8a46ea1..61991704b32f 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -138,7 +138,11 @@ jobs: - name: Build interaction tests shell: pwsh - run: 'dotnet build $env:INTERACTION_TESTS_PROJECT_PATH' + run: | + msbuild $env:INTERACTION_TESTS_PROJECT_PATH + -t:Build ` + -p:Configuration=$env:CONFIGURATION ` + -p:Platform=$env:PRIMARY_ARCHITECTURE - name: Run interaction tests shell: pwsh From e159d2fd6f58b03c3eb07adc7c66cee95c7ad6f8 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 1 Nov 2023 23:46:17 +0900 Subject: [PATCH 24/84] Update --- .github/workflows/build-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 61991704b32f..ec3cf4115d9b 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -139,7 +139,7 @@ jobs: - name: Build interaction tests shell: pwsh run: | - msbuild $env:INTERACTION_TESTS_PROJECT_PATH + msbuild $env:INTERACTION_TESTS_PROJECT_PATH ` -t:Build ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:PRIMARY_ARCHITECTURE From 094ba03bada7d693fee8fe0bad86695ca5b5457d Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 2 Nov 2023 00:05:19 +0900 Subject: [PATCH 25/84] Update --- .github/workflows/build-app.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index ec3cf4115d9b..ec9336eec55a 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -137,7 +137,6 @@ jobs: run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - name: Build interaction tests - shell: pwsh run: | msbuild $env:INTERACTION_TESTS_PROJECT_PATH ` -t:Build ` @@ -145,7 +144,6 @@ jobs: -p:Platform=$env:PRIMARY_ARCHITECTURE - name: Run interaction tests - shell: pwsh run: | dotnet test $env:INTERACTION_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll ` -a $env:PRIMARY_ARCHITECTURE ` From 0e9a22b3ab232b17356282637c547ac4398525c0 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 2 Nov 2023 00:21:01 +0900 Subject: [PATCH 26/84] Update --- .github/workflows/build-app.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index ec9336eec55a..a20fa9ca2056 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -119,6 +119,20 @@ jobs: 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' + - uses: actions/download-artifact@v3 with: name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PRIMARY_ARCHITECTURE }})' From 78880749673d31d0476035cebe97e4dfef48ee09 Mon Sep 17 00:00:00 2001 From: 0x5BFA <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 2 Nov 2023 00:36:59 +0900 Subject: [PATCH 27/84] Update --- .github/workflows/build-app.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index a20fa9ca2056..515e026532a3 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -150,6 +150,10 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force + - name: Restore NuGet + shell: pwsh + run: 'nuget restore $env:SOLUTION_PATH' + - name: Build interaction tests run: | msbuild $env:INTERACTION_TESTS_PROJECT_PATH ` From 0599c2077c3392c533a2b6f8476d45b97c2cfad4 Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Thu, 2 Nov 2023 12:26:37 +0100 Subject: [PATCH 28/84] Update actions to start WinAppDriver, add second app id to find app --- .github/workflows/build-app.yml | 3 +++ tests/Files.InteractionTests/SessionManager.cs | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 515e026532a3..320b83d033e7 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -150,6 +150,9 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force + - name: Start WinAppDriver + run: Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" + - name: Restore NuGet shell: pwsh run: 'nuget restore $env:SOLUTION_PATH' diff --git a/tests/Files.InteractionTests/SessionManager.cs b/tests/Files.InteractionTests/SessionManager.cs index e0690bcbd445..947e946cbbde 100644 --- a/tests/Files.InteractionTests/SessionManager.cs +++ b/tests/Files.InteractionTests/SessionManager.cs @@ -16,7 +16,8 @@ public class SessionManager private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; private static string[] FilesAppIDs = new string[]{ "49306atecsolution.FilesUWP_dwm5abbcs5pn0!App", - "FilesDev_ykqwq8d6ps0ag!App" + "FilesDev_ykqwq8d6ps0ag!App", + "FilesDev_dwm5abbcs5pn0!App" }; private static uint appIdIndex = 0; From 7a351d22eb07a4bec8246b41a3dd1d9eff280462 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 2 Nov 2023 21:23:38 +0900 Subject: [PATCH 29/84] Delete builds/azure-pipelines.yml --- builds/azure-pipelines.yml | 129 ------------------------------------- 1 file changed, 129 deletions(-) delete mode 100644 builds/azure-pipelines.yml diff --git a/builds/azure-pipelines.yml b/builds/azure-pipelines.yml deleted file mode 100644 index a7cd5f7d1cb9..000000000000 --- a/builds/azure-pipelines.yml +++ /dev/null @@ -1,129 +0,0 @@ -trigger: - branches: - include: - - main - paths: - exclude: - - '.github/**' - - 'docs/**' - - '*.md' - -pool: - vmImage: 'windows-latest' - -variables: - solution: '**/*.sln' - buildPlatform: 'x64' - buildConfiguration: 'Release' - appxPackageDir: '$(build.artifactStagingDirectory)\AppxPackages\\' - -steps: -- task: PowerShell@2 - inputs: - targetType: 'inline' - script: | - [xml]$xmlDoc = Get-Content '$(Build.SourcesDirectory)\src\Files.App (Package)\Package.appxmanifest' - $xmlDoc.Package.Identity.Name="49306atecsolution.FilesUWP" - $xmlDoc.Package.Identity.Publisher="CN=53EC4384-7F5B-4CF6-8C23-513FFE9D1AB7" - $xmlDoc.Package.Properties.DisplayName="Files" - $xmlDoc.Package.Applications.Application.VisualElements.DisplayName="Files" - $xmlDoc.Save('$(Build.SourcesDirectory)\src\Files.App (Package)\Package.appxmanifest') - failOnStderr: true - -- task: PowerShell@2 - displayName: 'Use Release Logo' - inputs: - targetType: 'inline' - script: | - gci $(Build.SourcesDirectory)\src -Include *.csproj, *.appxmanifest, *.wapproj -recurse | ForEach -Process { - (Get-Content $_ -Raw | ForEach -Process {$_ -replace "Assets\\AppTilesDev", "Assets\AppTiles"}) | Set-Content $_ -NoNewline - } - failOnStderr: true - -- task: DownloadSecureFile@1 - name: mapsDevKey - displayName: 'Download Bing Maps Dev Key' - inputs: - secureFile: 'BingMapsKey.txt' - -- task: CopyFiles@2 - inputs: - SourceFolder: '$(Agent.TempDirectory)' - Contents: '$(mapsDevKey.secureFilePath)' - TargetFolder: '$(Build.SourcesDirectory)\src\Files.App\Resources' - overWrite: true - -- task: UseDotNet@2 - inputs: - packageType: sdk - version: 7.0.x - includePreviewVersions: true - -- task: CmdLine@2 - inputs: - script: | - for /f %%a in ('dir /b /a:d %localappdata%\Microsoft\VisualStudio\17*') do echo UsePreviews=True>%localappdata%\Microsoft\VisualStudio\%%a\sdk.txt - -- task: MSBuild@1 - inputs: - platform: 'x64' - solution: '**/*.sln' - configuration: '$(buildConfiguration)' - msbuildArguments: '/t:restore /p:Configuration=Debug;Platform="$(buildPlatform)";PublishReadyToRun=true' - maximumCpuCount: true - -- task: MSBuild@1 - inputs: - platform: 'x64' - solution: '**/*.wapproj' - configuration: '$(buildConfiguration)' - msbuildArguments: '/t:build;_GenerateAppxPackage /p:Configuration=Debug;Platform="$(buildPlatform)";AppxBundle=Always;AppxBundlePlatforms="$(buildPlatform)";AppxPackageDir="$(appxPackageDir)";AppxPackageSigningEnabled=true;UapAppxPackageBuildMode=SideloadOnly;PackageCertificateKeyFile="$(Build.SourcesDirectory)\builds\Files_SelfSigned.pfx";PackageCertificatePassword="";PackageCertificateThumbprint=""' - maximumCpuCount: true - -- task: DotNetCoreCLI@2 - inputs: - command: 'build' - arguments: './tests/Files.InteractionTests/Files.InteractionTests.csproj --configuration $(buildConfiguration)' - -- task: PowerShell@2 - inputs: - targetType: 'inline' - script: | - # Find correct folder and run app install script. - cd $(appxPackageDir) - - $AppBundle = Get-ChildItem -Filter Files*Test -Name - echo $AppBundle - cd $AppBundle - ./Install.ps1 -Force - Get-AppxPackage - errorActionPreference: 'continue' - failOnStderr: true - workingDirectory: '$(System.DefaultWorkingDirectory)' - - -- task: Windows Application Driver@0 - inputs: - OperationType: 'Start' - AgentResolution: '1080p' - -- task: VSTest@2 - inputs: - testSelector: 'testAssemblies' - testAssemblyVer2: | - **\*Files.InteractionTests.dll - !**\*TestAdapter.dll - !**\obj\** - searchFolder: '$(System.DefaultWorkingDirectory)' - -- task: CopyFiles@2 - displayName: 'Copy Files to: $(build.artifactstagingdirectory)' - inputs: - SourceFolder: '$(system.defaultworkingdirectory)' - Contents: '**\bin\$(BuildConfiguration)\**' - TargetFolder: '$(build.artifactstagingdirectory)' - -- task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: drop' - inputs: - PathtoPublish: '$(build.artifactstagingdirectory)' From bb9ba6ea49759df9ff809d8d3b4f0ac99d5ff7b6 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 2 Nov 2023 21:28:49 +0900 Subject: [PATCH 30/84] Update and rename build-app.yml to ci.yml --- .github/workflows/{build-app.yml => ci.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{build-app.yml => ci.yml} (99%) diff --git a/.github/workflows/build-app.yml b/.github/workflows/ci.yml similarity index 99% rename from .github/workflows/build-app.yml rename to .github/workflows/ci.yml index 320b83d033e7..b8635059c84f 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/ci.yml @@ -5,7 +5,7 @@ # This CI is triggered when a commit was added in the main branch directly or # a commit was added in a PR whose base branch is the main branch within this repository. -name: Build & test Files +name: Files CI on: push: From 30ef09b74658d4acfad6eca3064ce97be45152d8 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 10:59:13 +0900 Subject: [PATCH 31/84] Update .github/workflows/ci.yml Co-authored-by: Yair <39923744+yaira2@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b8635059c84f..6831ac40a894 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,7 +83,7 @@ jobs: -p:AppxBundle=Never - if: env.ARCHITECTURE == env.PRIMARY_ARCHITECTURE - name: Build & Publish Files + name: Build & Package Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` -t:Build ` From ff3291ebebe6d365f9adde440a5823b01ac1f8c9 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 02:35:47 +0000 Subject: [PATCH 32/84] Update --- .github/workflows/ci.yml | 41 ++++++++++++++++++++-------------------- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6831ac40a894..751d51bdb711 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,23 +12,24 @@ on: branches: - main paths-ignore: - - 'docs/**' + - 'specs/**' - '*.md' pull_request: paths-ignore: - - 'docs/**' + - 'specs/**' - '*.md' +run-name: ${{ github.event_name == "pull_request" && "Files CI PR" || "Files CI Validation" }} + env: - APPLICATION_NAME: 'Files' - SOLUTION_NAME: 'Files.sln' - PRIMARY_ARCHITECTURE: 'x64' + 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' - INTERACTION_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests' - INTERACTION_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj' - WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' + 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' ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\builds\Files_SelfSigned.pfx' @@ -73,7 +74,7 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true - - if: env.ARCHITECTURE != env.PRIMARY_ARCHITECTURE + - if: env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE name: Build Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` @@ -82,15 +83,15 @@ jobs: -p:Platform=$env:ARCHITECTURE ` -p:AppxBundle=Never - - if: env.ARCHITECTURE == env.PRIMARY_ARCHITECTURE - name: Build & Package Files + - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION + name: Build & package Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` -t:Build ` -t:_GenerateAppxPackage ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:ARCHITECTURE ` - -p:AppxBundlePlatforms=$env:PRIMARY_ARCHITECTURE ` + -p:AppxBundlePlatforms=$env:AUTOMATED_TESTS_ARCHITECTURE ` -p:AppxBundle=Always ` -p:UapAppxPackageBuildMode=SideloadOnly ` -p:AppxPackageDir=$env:APPX_PACKAGE_DIR ` @@ -99,11 +100,11 @@ jobs: -p:PackageCertificatePassword="" ` -p:PackageCertificateThumbprint="" - - if: env.ARCHITECTURE == env.PRIMARY_ARCHITECTURE + - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION name: Upload the packages to GitHub Actions uses: actions/upload-artifact@v3 with: - name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PRIMARY_ARCHITECTURE }})' + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.CONFIGURATION }})' path: ${{ env.ARTIFACTS_STAGING_DIR }} test: @@ -112,7 +113,7 @@ jobs: strategy: fail-fast: false matrix: - configuration: [Debug] + configuration: [Release] platform: [x64] env: CONFIGURATION: ${{ matrix.configuration }} @@ -135,7 +136,7 @@ jobs: - uses: actions/download-artifact@v3 with: - name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.PRIMARY_ARCHITECTURE }})' + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.AUTOMATED_TESTS_ARCHITECTURE }})' path: ${{ env.ARTIFACTS_STAGING_DIR }} - name: Install package @@ -159,13 +160,13 @@ jobs: - name: Build interaction tests run: | - msbuild $env:INTERACTION_TESTS_PROJECT_PATH ` + msbuild $env:AUTOMATED_TESTS_PROJECT_PATH ` -t:Build ` -p:Configuration=$env:CONFIGURATION ` - -p:Platform=$env:PRIMARY_ARCHITECTURE + -p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE - name: Run interaction tests run: | - dotnet test $env:INTERACTION_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll ` - -a $env:PRIMARY_ARCHITECTURE ` + dotnet test $env:AUTOMATED_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll ` + -a $env:AUTOMATED_TESTS_ARCHITECTURE ` -c $env:CONFIGURATION From f9c8c1dc848b383666d0ab1313ab439edfb4abcd Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 02:36:36 +0000 Subject: [PATCH 33/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 751d51bdb711..d14c6008a07f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ on: - 'specs/**' - '*.md' -run-name: ${{ github.event_name == "pull_request" && "Files CI PR" || "Files CI Validation" }} +run-name: ${{ github.event_name == 'pull_request' && 'Files CI PR' || 'Files CI Validation' }} env: WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' From 4c12684a9f2f93aed43263bdd4a06989b42d6f1a Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 02:37:54 +0000 Subject: [PATCH 34/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d14c6008a07f..29f43e070381 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - configuration: [Debug] + configuration: [Debug, Release] platform: [x64, arm64] env: CONFIGURATION: ${{ matrix.configuration }} From 3e7222b2d5c4547eff399a8b1d2469cf3916b132 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 02:57:53 +0000 Subject: [PATCH 35/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29f43e070381..7ad51ee7db9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: name: Upload the packages to GitHub Actions uses: actions/upload-artifact@v3 with: - name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.CONFIGURATION }})' + name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})' path: ${{ env.ARTIFACTS_STAGING_DIR }} test: From f53d75e779fb9770d489ef976a7cfe8dee38d577 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 03:08:47 +0000 Subject: [PATCH 36/84] Fix if statement --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7ad51ee7db9a..c37b77468526 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,7 +74,7 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true - - if: env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE + - if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE name: Build Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` @@ -83,7 +83,7 @@ jobs: -p:Platform=$env:ARCHITECTURE ` -p:AppxBundle=Never - - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION + - if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE name: Build & package Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` From 81eef00cb11ac89f5dd2361441244a9da5064eb4 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 03:55:28 +0000 Subject: [PATCH 37/84] Update --- .github/workflows/ci.yml | 65 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c37b77468526..1b96407284eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,8 +30,9 @@ env: 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' - ARTIFACTS_STAGING_DIR: ${{ github.workspace }}\artifacts - APPX_PACKAGE_DIR: ${{ github.workspace }}\artifacts\AppxPackages + 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 }}\builds\Files_SelfSigned.pfx' jobs: @@ -101,7 +102,21 @@ jobs: -p:PackageCertificateThumbprint="" - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION - name: Upload the packages to GitHub Actions + name: Build interaction tests + run: | + msbuild $env:AUTOMATED_TESTS_PROJECT_PATH ` + -t:Build ` + -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 dll to the artifacts dir + shell: pwsh + run: | + Copy-Item $env:AUTOMATED_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll $env:AUTOMATED_TESTS_ASSEMBLY_DIR + + - 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 }})' @@ -123,23 +138,13 @@ jobs: - 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' - - - uses: actions/download-artifact@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 package + - name: Install Files shell: powershell run: | Set-Location "$env:APPX_PACKAGE_DIR" @@ -151,22 +156,18 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - - name: Start WinAppDriver - run: Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" - - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_PATH' - - - name: Build interaction tests - run: | - msbuild $env:AUTOMATED_TESTS_PROJECT_PATH ` - -t:Build ` - -p:Configuration=$env:CONFIGURATION ` - -p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE + - name: Publish tests result + with: + header: test-result + message: | + Waiting the tests running to finish. - name: Run interaction tests run: | - dotnet test $env:AUTOMATED_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll ` - -a $env:AUTOMATED_TESTS_ARCHITECTURE ` - -c $env:CONFIGURATION + dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll + + - name: Publish tests result + with: + header: test-result + message: | + The tests has been passed. From f371ff0463e07454133a77e6282be1426435a0ad Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 03:59:07 +0000 Subject: [PATCH 38/84] Updated --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1b96407284eb..5a8641d75e89 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,6 +157,7 @@ jobs: run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - name: Publish tests result + uses: marocchino/sticky-pull-request-comment@v2 with: header: test-result message: | @@ -167,6 +168,7 @@ jobs: dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll - name: Publish tests result + uses: marocchino/sticky-pull-request-comment@v2 with: header: test-result message: | From 32a292b801d2d3041c7cccf62fd0be89ec89d300 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:13:24 +0000 Subject: [PATCH 39/84] Update --- .github/workflows/ci.yml | 36 ++++-- scripts/Convert-TrxToMarkdown.ps1 | 189 ++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+), 12 deletions(-) create mode 100644 scripts/Convert-TrxToMarkdown.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5a8641d75e89..44ade7d669ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,20 +156,32 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - - name: Publish tests result - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: test-result - message: | - Waiting the tests running to finish. + # - name: Prepare tests result + # uses: marocchino/sticky-pull-request-comment@v2 + # with: + # header: test-result + # message: | + # Waiting the tests running to finish. - name: Run interaction tests run: | dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll + -l:"trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" - - name: Publish tests result - uses: marocchino/sticky-pull-request-comment@v2 - with: - header: test-result - message: | - The tests has been passed. + - name: TRX to MD + shell: pwsh + run: | + . './scripts/Convert-TrxToMarkdown.ps1' + -Source "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" + -Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md" + + - name: Show MD + 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' diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 new file mode 100644 index 000000000000..16d7d7071cf0 --- /dev/null +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -0,0 +1,189 @@ +# Copyright (c) 2023 Files Community +# Licensed under the MIT License. See the LICENSE. + +using namespace System.Collections.Generic; +using namespace System.Linq; + +param( + [string]$Source = "", + [string]$Destination = "" +) + +class Trx +{ + [ResultSummary] $ResultSummary + [TrxTimes] $Times + [TrxTestDefinition[]]$TestDefinitions + [TrxUnitTestResult[]]$Results + + Trx() + { + $this.Times = New-Object TrxTimes + $this.ResultSummary = New-Object ResultSummary + } +} + +class ResultSummary +{ + [int] $total + [int] $passed + [int] $failed +} + +class TrxTimes +{ + [Datetime] $creation + [Datetime] $queuing + [Datetime] $start + [Datetime] $finish +} + +class TrxTestDefinition +{ + [string] $name + [string] $id + [string] $className +} + +class TrxUnitTestResult +{ + [string] $result + [string] $name + [string] $errorMessage + [string] $errorStackTrace +} + +[xml]$xmlDoc = Get-Content $Source + +$trxObject = New-Object Trx + +# Result summary +$trxObject.ResultSummary.total = $xmlDoc.TestRun.ResultSummary.Counters.total +$trxObject.ResultSummary.passed = $xmlDoc.TestRun.ResultSummary.Counters.passed +$trxObject.ResultSummary.failed = $xmlDoc.TestRun.ResultSummary.Counters.failed + +# Times +$trxObject.Times.start = $xmlDoc.TestRun.Times.start +$trxObject.Times.finish = $xmlDoc.TestRun.Times.finish + +# Unit test definitions +foreach ($item in $xmlDoc.TestRun.TestDefinitions.UnitTest) +{ + $newOne = [TrxTestDefinition]::new() + + $newOne.name = $item.name + $newOne.id = $item.id + $newOne.className = $item.TestMethod.name + + $trxObject.TestDefinitions += $newOne +} + +# Unit tests +foreach ($item in $xmlDoc.TestRun.Results.UnitTestResult) +{ + $newOne = [TrxUnitTestResult]::new() + + $newOne.result = $item.outcome + $newOne.name = $item.testName + $newOne.errorMessage = $item.Output.ErrorInfo.Message + $newOne.errorStackTrace = $item.Output.ErrorInfo.StackTrace + + $trxObject.Results += $newOne +} + +$stringBuilder = New-Object System.Text.StringBuilder + +$title = "## Tested with Files " +$pullRequestId = 20 +$AbbreviatedOid = "1323058" +$resultOverview = "" + +# Header +[void]$stringBuilder.AppendLine($title); +[void]$stringBuilder.AppendLine(""); + +$skippedIcon = "⏩" +$passedIcon = "✅" +$failedIcon = "❌" +$unknownIcon = "⚠️" + +# Skipped +if ($trxObject.ResultSummary.failed -ne 0 -and $trxObject.ResultSummary.passed -ne 0) +{ + $resultOverview = $partialSuccessfulfulIcon + "Some tests were not successful" + $resultOverview = + $resultOverview +} +# Passed +elseif ($trxObject.ResultSummary.failed -eq 0) +{ + $resultOverview = $passedIcon + " All tests have passed" +} +# Failed +elseif ($trxObject.ResultSummary.failed -ne 0 -and $trxObject.ResultSummary.passed -eq 0) +{ + $resultOverview = $failedIcon + " All tests have failed" +} +else +{ + $resultOverview = $unknownIcon + " Unknown result" +} + +# Overview table +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine("
Commit:$AbbreviatedOid
Status:$resultOverview
Full log:https://github.com/files-community/Files/actions/runs/$GITHUB_RUN_ID/job/$GITHUB_JOB
"); +[void]$stringBuilder.AppendLine(""); + +if ($trxObject.ResultSummary.failed -eq 0) +{ + $stringBuilder.ToString() | Out-File -FilePath $Destination + Exit +} + +# Details Table +[void]$stringBuilder.AppendLine("### Details"); +[void]$stringBuilder.AppendLine("Name|Status|Failed class"); +[void]$stringBuilder.AppendLine(":---|:---|:---"); + +$index = 0 + +foreach ($item in $trxObject.Results) +{ + $resultStatus = "" + if ($item.result.Equals("Failed")) + { + $resultStatus = $failedIcon + " Failed" + } + elseif ($item.result.Equals("Passed")) + { + $resultStatus = $successfulIcon + " Passed" + } + else + { + $resultStatus = $skippedIcon + " Unknown" + } + + $failedClass = "_None_" + $testName = $item.name + if ($null -ne $item.errorMessage) + { + $failedClass = "" + $trxObject.TestDefinitions[0].className + "." + $item.name + } + + [void]$stringBuilder.AppendLine("$testName`|$resultStatus`|$failedClass"); + + $index = $index + 1 +} + +$stringBuilder.ToString() | Out-File -FilePath $Destination From 91bdbd7496e12009fe2d7919846506c9e062c6b6 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:32:37 +0000 Subject: [PATCH 40/84] Update --- scripts/Convert-TrxToMarkdown.ps1 | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index 16d7d7071cf0..99b5af88098d 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -40,13 +40,14 @@ class TrxTimes class TrxTestDefinition { - [string] $name [string] $id + [string] $name [string] $className } class TrxUnitTestResult { + [string] $id [string] $result [string] $name [string] $errorMessage @@ -71,9 +72,9 @@ foreach ($item in $xmlDoc.TestRun.TestDefinitions.UnitTest) { $newOne = [TrxTestDefinition]::new() + $newOne.id = $item.Execution.id $newOne.name = $item.name - $newOne.id = $item.id - $newOne.className = $item.TestMethod.name + $newOne.className = $item.TestMethod.className $trxObject.TestDefinitions += $newOne } @@ -83,6 +84,7 @@ foreach ($item in $xmlDoc.TestRun.Results.UnitTestResult) { $newOne = [TrxUnitTestResult]::new() + $newOne.id = $item.executionId $newOne.result = $item.outcome $newOne.name = $item.testName $newOne.errorMessage = $item.Output.ErrorInfo.Message @@ -94,8 +96,8 @@ foreach ($item in $xmlDoc.TestRun.Results.UnitTestResult) $stringBuilder = New-Object System.Text.StringBuilder $title = "## Tested with Files " -$pullRequestId = 20 -$AbbreviatedOid = "1323058" +$pullRequestId = ${{ github.event.pull_request.number }} +$AbbreviatedOid = $GITHUB_SHA.Substring(0, 7) $resultOverview = "" # Header @@ -111,7 +113,6 @@ $unknownIcon = "⚠️" if ($trxObject.ResultSummary.failed -ne 0 -and $trxObject.ResultSummary.passed -ne 0) { $resultOverview = $partialSuccessfulfulIcon + "Some tests were not successful" - $resultOverview = + $resultOverview } # Passed elseif ($trxObject.ResultSummary.failed -eq 0) @@ -176,14 +177,15 @@ foreach ($item in $trxObject.Results) $failedClass = "_None_" $testName = $item.name + $baseClassName = $trxObject.TestDefinitions | Where-Object { $_.id -eq $item.id } if ($null -ne $item.errorMessage) { - $failedClass = "" + $trxObject.TestDefinitions[0].className + "." + $item.name + $failedClass = "" + $baseClassName.className + "." + $item.name + "" } [void]$stringBuilder.AppendLine("$testName`|$resultStatus`|$failedClass"); - $index = $index + 1 + $index++ } $stringBuilder.ToString() | Out-File -FilePath $Destination From 0b4f060345597cd141baae31ff82444e020d0b53 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:33:09 +0000 Subject: [PATCH 41/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 44ade7d669ab..c8cfbbc46e5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,7 +166,7 @@ jobs: - name: Run interaction tests run: | dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll - -l:"trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" + --logger: "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" - name: TRX to MD shell: pwsh From fe2f5ab198bfe65c6dbb78d95ffbf4eb1035cb17 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:33:41 +0000 Subject: [PATCH 42/84] Update --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c8cfbbc46e5d..8dce4c8aa160 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -165,14 +165,14 @@ jobs: - name: Run interaction tests run: | - dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll + dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll ` --logger: "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" - name: TRX to MD shell: pwsh run: | - . './scripts/Convert-TrxToMarkdown.ps1' - -Source "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" + . './scripts/Convert-TrxToMarkdown.ps1' ` + -Source "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" ` -Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md" - name: Show MD From ed95c758619d043c53a1edd21be3cbd6c6acf668 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:48:58 +0000 Subject: [PATCH 43/84] Update --- .github/workflows/ci.yml | 4 +--- scripts/Convert-TrxToMarkdown.ps1 | 30 +++++++++++++++++++++++++++--- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8dce4c8aa160..89dbb129caee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,9 +164,7 @@ jobs: # Waiting the tests running to finish. - 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" + run: 'dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll --logger: "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx"' - name: TRX to MD shell: pwsh diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index 99b5af88098d..438f99eb9535 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -175,17 +175,41 @@ foreach ($item in $trxObject.Results) $resultStatus = $skippedIcon + " Unknown" } - $failedClass = "_None_" + $failedClassName = "_None_" $testName = $item.name $baseClassName = $trxObject.TestDefinitions | Where-Object { $_.id -eq $item.id } if ($null -ne $item.errorMessage) { - $failedClass = "" + $baseClassName.className + "." + $item.name + "" + $failedClassName = "" + $baseClassName.className + "." + $item.name + "" } - [void]$stringBuilder.AppendLine("$testName`|$resultStatus`|$failedClass"); + [void]$stringBuilder.AppendLine("$testName`|$resultStatus`|$failedClassName"); $index++ } +[void]$stringBuilder.AppendLine(""); + +[void]$stringBuilder.AppendLine("
"); +[void]$stringBuilder.AppendLine("View logs"); +[void]$stringBuilder.AppendLine("
"); +[void]$stringBuilder.AppendLine(""); + +foreach ($item in $trxObject.Results) +{ + $baseClassName = $trxObject.TestDefinitions | Where-Object { $_.id -eq $item.id } + $failedClassName = "" + $baseClassName.className + "." + $item.name + "" + $stackTraceText = $item.errorStackTrace + [void]$stringBuilder.AppendLine("**``Class: " + $baseClassName.className + "``**"); + + [void]$stringBuilder.AppendLine("``````"); + [void]$stringBuilder.AppendLine("$stackTraceText"); + [void]$stringBuilder.AppendLine("``````"); +} + +[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine("
"); +[void]$stringBuilder.AppendLine(""); + + $stringBuilder.ToString() | Out-File -FilePath $Destination From 98a14b29ccb6e9f706ebda201f83b337a9257216 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:49:34 +0000 Subject: [PATCH 44/84] Update --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 89dbb129caee..472998467d55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,14 +166,14 @@ jobs: - 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: TRX to MD + - name: Convert TRX to MD shell: pwsh run: | . './scripts/Convert-TrxToMarkdown.ps1' ` -Source "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" ` -Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md" - - name: Show MD + - name: Publish tests result shell: pwsh run: | Get-Content $env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md From f4a829331b0c9174e9a3073c8801ac3f2dfe1c54 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 13:57:13 +0000 Subject: [PATCH 45/84] Update --- scripts/Convert-TrxToMarkdown.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index 438f99eb9535..28e871ca8c50 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -198,13 +198,13 @@ foreach ($item in $trxObject.Results) foreach ($item in $trxObject.Results) { $baseClassName = $trxObject.TestDefinitions | Where-Object { $_.id -eq $item.id } - $failedClassName = "" + $baseClassName.className + "." + $item.name + "" - $stackTraceText = $item.errorStackTrace - [void]$stringBuilder.AppendLine("**``Class: " + $baseClassName.className + "``**"); + $failedClassName = $baseClassName.className + "." + $item.name + [void]$stringBuilder.AppendLine("- **" + $failedClassName + "**"); - [void]$stringBuilder.AppendLine("``````"); - [void]$stringBuilder.AppendLine("$stackTraceText"); - [void]$stringBuilder.AppendLine("``````"); + $stackTraceText = $item.errorStackTrace + [void]$stringBuilder.AppendLine(" ``````"); + [void]$stringBuilder.Append("$stackTraceText"); + [void]$stringBuilder.AppendLine(" ``````"); } [void]$stringBuilder.AppendLine(""); From 962c15f03b1535a331c2224ddb9304cb7cb04d0d Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Sun, 5 Nov 2023 23:24:40 +0900 Subject: [PATCH 46/84] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 472998467d55..d980a6543cd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: # Waiting the tests running to finish. - 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"' + run: 'dotnet test $env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll --logger "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx"' - name: Convert TRX to MD shell: pwsh From fe741858b50da7e08e198d400776d29eaed14efa Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 13:10:09 +0900 Subject: [PATCH 47/84] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d980a6543cd8..b49138d14ca7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: name: Copy tests dll to the artifacts dir shell: pwsh run: | - Copy-Item $env:AUTOMATED_TESTS_PROJECT_DIR\bin\**\Files.InteractionTests.dll $env:AUTOMATED_TESTS_ASSEMBLY_DIR + Copy-Item $env:AUTOMATED_TESTS_PROJECT_DIR\bin\ $env:AUTOMATED_TESTS_ASSEMBLY_DIR - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION name: Upload the packages to the Artifacts From 2134186042ab983ec9368c7424bc10ea56307d6b Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 07:46:46 +0000 Subject: [PATCH 48/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b49138d14ca7..60839be9af94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: name: Copy tests dll to the artifacts dir shell: pwsh run: | - Copy-Item $env:AUTOMATED_TESTS_PROJECT_DIR\bin\ $env:AUTOMATED_TESTS_ASSEMBLY_DIR + 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 From 8dc815dbcf47af17a2e63b8a3ef0bd7e8283288a Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:46:13 +0000 Subject: [PATCH 49/84] Update to run WinAppDriver :( --- .github/workflows/ci.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 60839be9af94..9db1a3986bc0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -156,23 +156,20 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - # - name: Prepare tests result - # uses: marocchino/sticky-pull-request-comment@v2 - # with: - # header: test-result - # message: | - # Waiting the tests running to finish. + - name: Start WinAppDriver + run: Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" - 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: Convert TRX to MD + - 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" + # This is a temporaly step for debugging - name: Publish tests result shell: pwsh run: | From d6782a3007fffe76cac86c5532ad4618c883bc23 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:50:57 +0000 Subject: [PATCH 50/84] Update --- .github/workflows/ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9db1a3986bc0..c5b2ad9bd8c3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,8 +2,10 @@ # Licensed under the MIT License. See the LICENSE. # Abstract: -# This CI is triggered when a commit was added in the main branch directly or -# a commit was added in a PR whose base branch is the main branch within this repository. +# - This CI is executed when a new commit is created on the main branch or +# on a PR whose base 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 From 64acb6db5977b8c823017944da4c6c3f93373884 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:54:08 +0000 Subject: [PATCH 51/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5b2ad9bd8c3..d399001f99b9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ on: - 'specs/**' - '*.md' -run-name: ${{ github.event_name == 'pull_request' && 'Files CI PR' || 'Files CI Validation' }} +run-name: ${{ github.event_name == 'pull_request' && "Files CI:: ${{ github.event.pull_request.title }}" || 'Files CI' }} env: WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' From 28f1595a820ab45068201927b789fdd70e5e78ab Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:56:45 +0000 Subject: [PATCH 52/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d399001f99b9..2718fc563e20 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ on: - 'specs/**' - '*.md' -run-name: ${{ github.event_name == 'pull_request' && "Files CI:: ${{ github.event.pull_request.title }}" || 'Files CI' }} +run-name: ${{ github.event_name == 'pull_request' && 'Files CI":" ${{ github.event.pull_request.title }}' || 'Files CI' }} env: WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' From 7182f9539b0e176765b5f0838fb4c27a5443ebad Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:57:25 +0000 Subject: [PATCH 53/84] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2718fc563e20..14226c3be314 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ on: - 'specs/**' - '*.md' -run-name: ${{ github.event_name == 'pull_request' && 'Files CI":" ${{ github.event.pull_request.title }}' || 'Files CI' }} +run-name: ${{ github.event_name == 'pull_request' && 'Files PR Validation || 'Files CI Validation' }} env: WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' From 0b892627384150eab366b6d7a6940d8706157f98 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 09:58:08 +0000 Subject: [PATCH 54/84] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14226c3be314..fb86b7c78077 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ on: - 'specs/**' - '*.md' -run-name: ${{ github.event_name == 'pull_request' && 'Files PR Validation || 'Files CI Validation' }} +run-name: ${{ github.event_name == 'pull_request' && 'Files PR Validation' || 'Files CI Validation' }} env: WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files' From 468c647fc888e199708144a7e9966da291d75f31 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:25:46 +0000 Subject: [PATCH 55/84] Update --- scripts/Convert-TrxToMarkdown.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index 28e871ca8c50..56a7e2a1f912 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -96,7 +96,7 @@ foreach ($item in $xmlDoc.TestRun.Results.UnitTestResult) $stringBuilder = New-Object System.Text.StringBuilder $title = "## Tested with Files " -$pullRequestId = ${{ github.event.pull_request.number }} +$pullRequestId = $env:github.event.pull_request.number $AbbreviatedOid = $GITHUB_SHA.Substring(0, 7) $resultOverview = "" From a2968503e744cf36b89266c24ebea81f899bf7e5 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 10:44:22 +0000 Subject: [PATCH 56/84] Update --- .github/workflows/ci.yml | 2 +- scripts/Convert-TrxToMarkdown.ps1 | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb86b7c78077..a08fa3e5cca8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ # Abstract: # - This CI is executed when a new commit is created on the main branch or -# on a PR whose base branch is the main branch. +# 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. diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index 56a7e2a1f912..4c49d1a54324 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -97,7 +97,8 @@ $stringBuilder = New-Object System.Text.StringBuilder $title = "## Tested with Files " $pullRequestId = $env:github.event.pull_request.number -$AbbreviatedOid = $GITHUB_SHA.Substring(0, 7) +$AbbreviatedOid = $env:GITHUB_SHA +$AbbreviatedOid = $AbbreviatedOid.Substring(0, 7) $resultOverview = "" # Header From 384624f721c8d8bf2400528ff6de6261ad35aeb1 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 22:50:08 +0900 Subject: [PATCH 57/84] Update Convert-TrxToMarkdown.ps1 --- scripts/Convert-TrxToMarkdown.ps1 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index 4c49d1a54324..c4e9504042d0 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -96,7 +96,6 @@ foreach ($item in $xmlDoc.TestRun.Results.UnitTestResult) $stringBuilder = New-Object System.Text.StringBuilder $title = "## Tested with Files " -$pullRequestId = $env:github.event.pull_request.number $AbbreviatedOid = $env:GITHUB_SHA $AbbreviatedOid = $AbbreviatedOid.Substring(0, 7) $resultOverview = "" @@ -134,7 +133,7 @@ else [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); -[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); @@ -142,7 +141,7 @@ else [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); -[void]$stringBuilder.AppendLine(""); +[void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine(""); [void]$stringBuilder.AppendLine("
Commit:$AbbreviatedOid$AbbreviatedOid
Status:
Full log:https://github.com/files-community/Files/actions/runs/$GITHUB_RUN_ID/job/$GITHUB_JOBhttps://github.com/files-community/Files/actions/runs/$GITHUB_RUN_ID/job/$GITHUB_JOB
"); [void]$stringBuilder.AppendLine(""); From f92cccb0dc074fa6ada998f0c62a5efe45e667ee Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 22:50:54 +0900 Subject: [PATCH 58/84] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a08fa3e5cca8..39c5c2a7c34e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,6 +170,8 @@ jobs: . './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 }} # This is a temporaly step for debugging - name: Publish tests result From 822fd936997923dfbb331afe3774c9f9e6601451 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Mon, 6 Nov 2023 14:33:29 +0000 Subject: [PATCH 59/84] Update --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a08fa3e5cca8..4949b3eb6b1a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,6 +134,9 @@ jobs: platform: [x64] env: CONFIGURATION: ${{ matrix.configuration }} + permissions: + contents: read + pull-requests: write steps: From 00cb8f0cebb12b1575c0ba21f9824f35ee801d11 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:22:47 +0000 Subject: [PATCH 60/84] Done --- .github/workflows/ci.yml | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1ba0073aa3c3..58a3613eadf7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,7 @@ jobs: -p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE - if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION - name: Copy tests dll to the artifacts dir + name: Copy tests binaries to the artifacts dir shell: pwsh run: | Copy-Item -Path "$env:AUTOMATED_TESTS_PROJECT_DIR\bin" -Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR" -Recurse @@ -161,29 +161,28 @@ jobs: - name: Set full HD resolution run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - - name: Start WinAppDriver + - name: Start WinAppDriver process run: Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" - 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 }} - - # This is a temporaly step for debugging - - name: Publish tests result - shell: pwsh - run: | - Get-Content $env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md + # - 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' + # uses: marocchino/sticky-pull-request-comment@v2 + # with: + # header: test-result + # path: '${{ env.AUTOMATED_TESTS_ASSEMBLY_DIR }}\testResults.md' From 04b0754e3c4a299ae228a6ad1c102cbe6c5701c8 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 07:39:22 +0000 Subject: [PATCH 61/84] Remove annotations --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58a3613eadf7..1fc1f1fdf9d8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,6 +124,11 @@ jobs: name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})' path: ${{ env.ARTIFACTS_STAGING_DIR }} + - name: Remove annotations + run: | + echo "::remove-matcher owner=eslint-compact::" + echo "::remove-matcher owner=eslint-stylish::" + test: needs: [build] runs-on: windows-latest From a8bcb2996c8704fef921bde6aed728c4c6d399e2 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:06:40 +0000 Subject: [PATCH 62/84] Supress warnings --- .github/workflows/ci.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fc1f1fdf9d8..3d6823e8a576 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -92,6 +92,7 @@ jobs: 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 ` @@ -108,6 +109,7 @@ jobs: run: | msbuild $env:AUTOMATED_TESTS_PROJECT_PATH ` -t:Build ` + -clp:ErrorsOnly ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE @@ -124,11 +126,6 @@ jobs: name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})' path: ${{ env.ARTIFACTS_STAGING_DIR }} - - name: Remove annotations - run: | - echo "::remove-matcher owner=eslint-compact::" - echo "::remove-matcher owner=eslint-stylish::" - test: needs: [build] runs-on: windows-latest From cb35cbd2c621ef3f5a6a287b67f3a0df57fb1ef4 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 08:28:22 +0000 Subject: [PATCH 63/84] Remove annotations 2 --- .github/workflows/ci.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3d6823e8a576..ab9aeb99d62c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,8 @@ env: ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\builds\Files_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: build: @@ -82,6 +84,7 @@ jobs: run: | msbuild $env:PACKAGE_PROJECT_PATH ` -t:Build ` + -clp:ErrorsOnly ` -p:Configuration=$env:CONFIGURATION ` -p:Platform=$env:ARCHITECTURE ` -p:AppxBundle=Never @@ -164,7 +167,8 @@ jobs: run: Set-DisplayResolution -Width 1920 -Height 1080 -Force - name: Start WinAppDriver process - run: Start-Process -FilePath "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe" + 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"' From 6d627b00f00ebbe2712c7f58096d4c54c532d312 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 10:27:13 +0000 Subject: [PATCH 64/84] Fix conditional job running --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ab9aeb99d62c..fc0589194a6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -79,7 +79,7 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true - - if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE + - if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION || env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE name: Build Files run: | msbuild $env:PACKAGE_PROJECT_PATH ` From 87494dc39e81c72d49ca61f3cf75aa168c055a49 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:10:20 +0000 Subject: [PATCH 65/84] Update --- .github/workflows/ci.yml | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc0589194a6d..931b47549d50 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ # - However, the CI will not be executed if files not directly related to # source code maintenance are updated. -name: Files CI +name: Files CIXamlStyler on: push: @@ -40,6 +40,38 @@ env: WINAPPDRIVER_EXE64_PATH: 'C:\Program Files\Windows Application Driver\WinAppDriver.exe' jobs: + + check-formatting: + runs-on: windows-latest + + steps: + - name: Checkout the repository + uses: actions/checkout@v3 + + - name: Install XamlStyler console + shell: pwsh + run: 'dotnet tool install --global .Console' + + - name: Check XAML formatting + id: check-step + shell: pwsh + 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 + + - if: steps.check-step.outcome == 'failure' + name: Post Check XAML formatting + shell: pwsh + run: exit 1 + build: runs-on: windows-latest strategy: From 320d6fe753bb450b2501e143ea0beecb6c5b9cd1 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:12:22 +0000 Subject: [PATCH 66/84] Fixed tool name --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 931b47549d50..42b0ba0b1511 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -50,7 +50,7 @@ jobs: - name: Install XamlStyler console shell: pwsh - run: 'dotnet tool install --global .Console' + run: 'dotnet tool install --global XamlStyler.Console' - name: Check XAML formatting id: check-step From b675fc85e9b64b2443a79cfb00e714c0e12108dd Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:13:32 +0000 Subject: [PATCH 67/84] Update --- .github/workflows/ci.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 42b0ba0b1511..7cfa1f4727bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,13 @@ jobs: - name: Checkout the repository uses: actions/checkout@v3 + - name: Validate this job + shell: pwsh + run: | + $changedFiles = (git diff --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} + if ($changedFiles.Count == 0) + exit 0 + - name: Install XamlStyler console shell: pwsh run: 'dotnet tool install --global XamlStyler.Console' From a9ed8dc9bd62bd1948234ac72c32f2c9b7a56188 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:14:06 +0000 Subject: [PATCH 68/84] Fix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7cfa1f4727bd..c5b350e18d26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ # - However, the CI will not be executed if files not directly related to # source code maintenance are updated. -name: Files CIXamlStyler +name: Files CI on: push: From b8e730c510198ef2c912d5c3f6baa99542e60c29 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:15:39 +0000 Subject: [PATCH 69/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c5b350e18d26..0c452230a2a3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,7 +52,7 @@ jobs: shell: pwsh run: | $changedFiles = (git diff --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} - if ($changedFiles.Count == 0) + if ($changedFiles.Count -eq 0) exit 0 - name: Install XamlStyler console From 2405f723c07e76ab3a93f5d98883e0fb6085965c Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:36:34 +0000 Subject: [PATCH 70/84] Fix --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c452230a2a3..2202f06a5acf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,9 @@ jobs: run: | $changedFiles = (git diff --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} if ($changedFiles.Count -eq 0) + { exit 0 + } - name: Install XamlStyler console shell: pwsh From 69f60035000a6b33a1f8598a70efb53c78ff5bfc Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:45:11 +0000 Subject: [PATCH 71/84] Update --- .github/workflows/ci.yml | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2202f06a5acf..865741a2ad94 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,28 +42,19 @@ env: jobs: check-formatting: - runs-on: windows-latest + runs-on: ubuntu-latest + defaults: + run: + shell: pwsh steps: - - name: Checkout the repository - uses: actions/checkout@v3 - - - name: Validate this job - shell: pwsh - run: | - $changedFiles = (git diff --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} - if ($changedFiles.Count -eq 0) - { - exit 0 - } - + - uses: actions/checko + - name: Install XamlStyler console - shell: pwsh run: 'dotnet tool install --global XamlStyler.Console' - name: Check XAML formatting id: check-step - shell: pwsh run: | $changedFiles = (git diff --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} foreach ($file in $changedFiles) @@ -76,9 +67,8 @@ jobs: } continue-on-error: true - - if: steps.check-step.outcome == 'failure' - name: Post Check XAML formatting - shell: pwsh + - name: Fail the job + if: steps.check-step.outcome == 'failure' run: exit 1 build: From 10b0f80d1261875f456feba89e34d649c2b9ed38 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Tue, 7 Nov 2023 13:46:44 +0000 Subject: [PATCH 72/84] Update --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 865741a2ad94..2157c1de6c2c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,9 @@ jobs: shell: pwsh steps: - - uses: actions/checko + + - name: Checkout the repository + uses: actions/checkout@v3 - name: Install XamlStyler console run: 'dotnet tool install --global XamlStyler.Console' @@ -83,6 +85,7 @@ jobs: ARCHITECTURE: ${{ matrix.platform }} steps: + - name: Checkout the repository uses: actions/checkout@v3 From ed3b54ebe81637337e08b266471760405071e567 Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Tue, 7 Nov 2023 22:55:38 +0100 Subject: [PATCH 73/84] Switch to self sign script --- .github/workflows/ci.yml | 3 +++ builds/Files_SelfSigned.pfx | Bin 2528 -> 0 bytes builds/GenerateTestPfx.ps1 | 12 ++++++++++++ 3 files changed, 15 insertions(+) delete mode 100644 builds/Files_SelfSigned.pfx create mode 100644 builds/GenerateTestPfx.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2157c1de6c2c..f97ab9ac3995 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,6 +113,9 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true + - name: Create self signed certificate + run: ./builds/GenerateTestPFX.ps1 + - if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION || env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE name: Build Files run: | diff --git a/builds/Files_SelfSigned.pfx b/builds/Files_SelfSigned.pfx deleted file mode 100644 index ad8719910d5b19be2eec5d8611a231500cc05ad7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2528 zcmZXUc{tQ-8^?dcFpYf}`>yQAX)tyP8HvblkUg>+${JxtlSxIklM>+&S<~2=Y$Yb* zC|R>4Lm1glyv+OSTvAg3_R2B)-`ulX+T1!#onu|Q zNFus5@nqU#eIuWH#(8(P6~jftC6@0@W{3BQ?~{=ZvdF}){*pl<^G-Q2=Lmj)!VMr(4vf=yCJlOl zDv!I;kH(I<0o)Bi!)*kU>kZ3921=!?{_*4&f`}5Pfk?U^UBWpopP_v7e3N9m|3OG_ z2v=#T?%o}4g^0l_e~RvL2<7sgUI3=)HI!jtC%vT29)pT?Ik7uMF|G9;53wIlh*o5g zn>=B(@j*(N|6_V}$uqs~dCE{zbH|6O9h7tdS8scE+B&SmBu^< z39*my_kqZl5gw(POwC0kx1-f`pn3db51T6W+J)Ndw(}HW^M$J;hZojv=x)U-e8 zQ899SZ1+xkxrpanP~)?leFZ3dk3Q;tiy^AEIuis?dPT0Eb@lT~SM{OyCJI_~O9N#b zVo;tk-=|&pR1rb87vr<1EjaT}5{i4nXws4^`R_{LH5{j=Y|1AI+pfu{G+XFo+SQY1 zt9oA1kgz6X06Q)_S%_=hD0^OO7EbAzIr*(Ris`6YLRLZJKQAY)~#;Vz^g^X+Y zx5^4O9&*q87CID~&{lqZj;49HaW_t5m`|9QT_?e}W4d4adDmgv8IwyDR!4L1`)=77 zm-QK~ODZAn4BA*a9 z>r`_#bSYFmo{HQTyA12QGoA}}zv0bO@nfM6*SrP??_M>A?hQYo-U=&v%`yKjVoSj| zDJ(8$j765NTUB&!7qDujlJ$RqOjlI1>C!YEG9g-Pzc&L>MYq{o$&FklG7}n=+b_SD z>1S+BCqHt#U0D;*m7-IlpDmpF`|7Z|${C7B=Jez`1h-eOhpvo>EqT#3p6=L44@rwg ztU3vvKW%wZ!>3bv#B|OlwGo@8StYpx9d@~*SjCFH zg?2@lPF7Mpa4eS%$EENRu$!anEICoNL5Z9zbmx{i2gU%dZs}5rlmE+r%=0@P5?AJ= z)9ZNn&bCsnZm3b~vM$`v?JDpOPDdz?n48J!nfjqZBDnCZasA%!)+Wz4VyL(>zs1eD z^_0)O0`?r5u61nH)Vk#O}GAtAxQCl?lvEvEop zxYRTgTzz%_kAb}rt7RiagMn@*X4@vk$;e27sA9=Lfv|afl%W;R9qDowRu^7Dq8*4=Q3{&0bNOz0;rcilhCz8iqf&SydPyW zyS6MO^SHL6M$;?S-=DmveBh{!!oI%tP8=%8ySEwBx3 zC{1)FV*t13X;$|5$R^@qQU_Xn{>?8X^us*I#m32_KS%kIV<@dy!WcyIQ-9%0pY2;p^QzY+^5&0o&_NdBoEVe!vo8UyVofz+xB6nayZnC z*3QN#WK79@UGHyD>diHGAd5feG`)6|%0(M^|L7#aL%zG&N%BEHHK zAazR~((#`@t|`x3-BF=YY%)Qh!E0#iabQ#85Zy+YNJc7tip8%d`#9)fcHHy9KB z3}j9~kYe**5Q6{G@8_weIh@>Twb^HC$CMqOwz7XUSIaF6h4<)Fhq37IHU%mNLIONa zJKAwuA5W4jj&=l=Y?<*E>p8)aSV7r#T)ALf!4Eg_xvE(|8zRA``Vowu(S4gG^9FIO z7fuqjV>05Z;Nuk4nGlRo{h|7Pp7Tv_2OXt{l0?B+S(Le$nM9yS`76A{hQ&>e~q4|7WZ diff --git a/builds/GenerateTestPfx.ps1 b/builds/GenerateTestPfx.ps1 new file mode 100644 index 000000000000..34e31807e3dc --- /dev/null +++ b/builds/GenerateTestPfx.ps1 @@ -0,0 +1,12 @@ +$CertificateFriendlyName = "Files_SelfSigned" +$Publisher = "CN=Files_Org" + +$cert = New-SelfSignedCertificate -Type Custom ` + -Subject $Publisher ` + -KeyUsage DigitalSignature ` + -FriendlyName $CertificateFriendlyName ` + -CertStoreLocation "Cert:\CurrentUser\My" ` + -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") + +$certificateBytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pkcs12) +[System.IO.File]::WriteAllBytes("$PSScriptRoot\Files_SelfSigned.pfx", $certificateBytes) \ No newline at end of file From a603ea4cac22592a75ea0d996bcb4a410f54b094 Mon Sep 17 00:00:00 2001 From: Marcel Wagner Date: Tue, 7 Nov 2023 23:15:27 +0100 Subject: [PATCH 74/84] Add additional app identity --- tests/Files.InteractionTests/SessionManager.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/Files.InteractionTests/SessionManager.cs b/tests/Files.InteractionTests/SessionManager.cs index 947e946cbbde..3a0373c5f3ce 100644 --- a/tests/Files.InteractionTests/SessionManager.cs +++ b/tests/Files.InteractionTests/SessionManager.cs @@ -17,7 +17,8 @@ public class SessionManager private static string[] FilesAppIDs = new string[]{ "49306atecsolution.FilesUWP_dwm5abbcs5pn0!App", "FilesDev_ykqwq8d6ps0ag!App", - "FilesDev_dwm5abbcs5pn0!App" + "FilesDev_dwm5abbcs5pn0!App", + "FilesDev_9bhem8es8z4gp!App", }; private static uint appIdIndex = 0; From 53e441cabb487b37a3b3806f03ee5d187c8f794f Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:54:13 +0900 Subject: [PATCH 75/84] Delete .github/workflows/check-xaml-formatting.yml --- .github/workflows/check-xaml-formatting.yml | 49 --------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/workflows/check-xaml-formatting.yml diff --git a/.github/workflows/check-xaml-formatting.yml b/.github/workflows/check-xaml-formatting.yml deleted file mode 100644 index 44b034176ff3..000000000000 --- a/.github/workflows/check-xaml-formatting.yml +++ /dev/null @@ -1,49 +0,0 @@ -name: Check XAML Formatting -on: - workflow_dispatch: - push: - branches: - - 'main' - - 'service/**' - paths: - - '**.xaml' - pull_request: - branches: - - 'main' - - 'service/**' - paths: - - '**.xaml' - -jobs: - check-formatting: - runs-on: ubuntu-latest - defaults: - run: - shell: pwsh - steps: - - uses: actions/checkout@v3 - with: - fetch-depth: 2 - - - name: Install Xaml Styler - run: | - dotnet tool install --global XamlStyler.Console - - - name: Check 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 job if necessary - if: steps.check-step.outcome == 'failure' - run: exit 1 - From 35b26e9df3fe311af979bd3bf62da525bc4c61e8 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 16:55:00 +0900 Subject: [PATCH 76/84] Update ci.yml --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f97ab9ac3995..9ff219e0c333 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,6 +51,8 @@ jobs: - name: Checkout the repository uses: actions/checkout@v3 + with: + fetch-depth: 2 - name: Install XamlStyler console run: 'dotnet tool install --global XamlStyler.Console' From d5ec8d698e9833797b7c4f281949a647b1ecd356 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 08:20:24 +0000 Subject: [PATCH 77/84] Update --- .github/workflows/ci.yml | 4 ++-- builds/GenerateTestPfx.ps1 | 12 ------------ scripts/Convert-TrxToMarkdown.ps1 | 4 ++++ scripts/Generate-SelfCertPfx.ps1 | 28 ++++++++++++++++++++++++++++ 4 files changed, 34 insertions(+), 14 deletions(-) delete mode 100644 builds/GenerateTestPfx.ps1 create mode 100644 scripts/Generate-SelfCertPfx.ps1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ff219e0c333..d42f87dd7bab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ env: 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 }}\builds\Files_SelfSigned.pfx' + APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\.github\temp\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' @@ -116,7 +116,7 @@ jobs: -p:PublishReadyToRun=true - name: Create self signed certificate - run: ./builds/GenerateTestPFX.ps1 + 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 Files diff --git a/builds/GenerateTestPfx.ps1 b/builds/GenerateTestPfx.ps1 deleted file mode 100644 index 34e31807e3dc..000000000000 --- a/builds/GenerateTestPfx.ps1 +++ /dev/null @@ -1,12 +0,0 @@ -$CertificateFriendlyName = "Files_SelfSigned" -$Publisher = "CN=Files_Org" - -$cert = New-SelfSignedCertificate -Type Custom ` - -Subject $Publisher ` - -KeyUsage DigitalSignature ` - -FriendlyName $CertificateFriendlyName ` - -CertStoreLocation "Cert:\CurrentUser\My" ` - -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") - -$certificateBytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pkcs12) -[System.IO.File]::WriteAllBytes("$PSScriptRoot\Files_SelfSigned.pfx", $certificateBytes) \ No newline at end of file diff --git a/scripts/Convert-TrxToMarkdown.ps1 b/scripts/Convert-TrxToMarkdown.ps1 index c4e9504042d0..3c21ebf14dde 100644 --- a/scripts/Convert-TrxToMarkdown.ps1 +++ b/scripts/Convert-TrxToMarkdown.ps1 @@ -1,6 +1,10 @@ # Copyright (c) 2023 Files Community # Licensed under the MIT License. See the LICENSE. +# Abstract: +# This script analyzes the trx file that is the result of executing dotnet test and +# converts it to markdown, which is used for the Files CI. + using namespace System.Collections.Generic; using namespace System.Linq; diff --git a/scripts/Generate-SelfCertPfx.ps1 b/scripts/Generate-SelfCertPfx.ps1 new file mode 100644 index 000000000000..e7ce69cc80d1 --- /dev/null +++ b/scripts/Generate-SelfCertPfx.ps1 @@ -0,0 +1,28 @@ +# Copyright (c) 2023 Files Community +# Licensed under the MIT License. See the LICENSE. + +# Abstract: +# This script generates a self-signed certificate for the temporary packaging as a pfx file. + +param( + [string]$Destination = "" +) + +$CertFriendlyName = "FilesApp_SelfSigned" +$CertPublisher = "CN=Files" +$CertStoreLocation = "Cert:\CurrentUser\My" + +# Generate self signed cert +$cert = New-SelfSignedCertificate ` + -Type Custom ` + -Subject $CertPublisher ` + -KeyUsage DigitalSignature ` + -FriendlyName $CertFriendlyName ` + -CertStoreLocation $CertStoreLocation ` + -TextExtension @("2.5.29.37={text}1.3.6.1.5.5.7.3.3", "2.5.29.19={text}") + +# Get size of the self signed cert +$certificateBytes = $cert.Export([System.Security.Cryptography.X509Certificates.X509ContentType]::Pkcs12) + +# Save the self signed cert as a file +[System.IO.File]::WriteAllBytes($Destination, $certificateBytes) \ No newline at end of file From d2f87ad47fcd0d8e9974bf49772c7502518eb03e Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 08:26:17 +0000 Subject: [PATCH 78/84] Update --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d42f87dd7bab..d0d537ddca82 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -35,7 +35,7 @@ env: 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\temp\FilesApp_SelfSigned.pfx' + 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' From 184d1dd6ba9ca01c91adf24fcba6d3bf8106d7bf Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 08:45:04 +0000 Subject: [PATCH 79/84] Updated --- .github/workflows/ci.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0d537ddca82..43bebe0c9a78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -115,9 +115,6 @@ jobs: -p:Configuration=$env:CONFIGURATION ` -p:PublishReadyToRun=true - - name: Create self signed certificate - 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 Files run: | @@ -127,7 +124,11 @@ jobs: -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: | From 8a406d2d1a23af467a37e8e7a35cb2b7e1cd2dee Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:16:59 +0000 Subject: [PATCH 80/84] Update --- .github/workflows/ci.yml | 80 ++++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 36 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 43bebe0c9a78..0245a57b7bf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,7 @@ jobs: } continue-on-error: true - - name: Fail the job + - name: Fail the job if the XamlStyler found unformatted file(s) if: steps.check-step.outcome == 'failure' run: exit 1 @@ -102,28 +102,30 @@ jobs: with: dotnet-version: '7.0.x' - - name: Restore NuGet - shell: pwsh - run: 'nuget restore $env:SOLUTION_PATH' + # - 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 + dotnet restore ` + $env:SOLUTION_PATH + + # -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 + dotnet 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 @@ -132,35 +134,38 @@ jobs: - 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="" + dotnet 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 + -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 binaries to the artifacts dir + 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 + 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 @@ -211,7 +216,10 @@ jobs: 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"' + 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 From ad1a7b19296b9f7e3ac63faf20192e6198ad666b Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:21:33 +0000 Subject: [PATCH 81/84] Fix --- .github/workflows/ci.yml | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0245a57b7bf4..6d71c68f3d7c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,24 +102,23 @@ jobs: with: dotnet-version: '7.0.x' - # - name: Restore NuGet - # shell: pwsh - # run: 'nuget restore $env:SOLUTION_PATH' + - name: Restore NuGet + shell: pwsh + run: 'nuget restore $env:SOLUTION_PATH' - name: Restore Files shell: pwsh run: | - dotnet restore ` - $env:SOLUTION_PATH - - # -p:Platform=$env:ARCHITECTURE ` - # -p:Configuration=$env:CONFIGURATION ` - # -p:PublishReadyToRun=true + 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: | - dotnet msbuild ` + msbuild ` $env:PACKAGE_PROJECT_PATH ` -t:Build ` -clp:ErrorsOnly ` @@ -134,7 +133,7 @@ jobs: - if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE name: Build & package Files run: | - dotnet msbuild ` + msbuild ` $env:PACKAGE_PROJECT_PATH ` -t:Build ` -t:_GenerateAppxPackage ` From 3684adf8bb0751a87a6d8a673fedf8b77f8765cd Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 9 Nov 2023 07:38:42 +0900 Subject: [PATCH 82/84] Update SessionManager.cs --- tests/Files.InteractionTests/SessionManager.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/Files.InteractionTests/SessionManager.cs b/tests/Files.InteractionTests/SessionManager.cs index 3a0373c5f3ce..8066919387f4 100644 --- a/tests/Files.InteractionTests/SessionManager.cs +++ b/tests/Files.InteractionTests/SessionManager.cs @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Files Community +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. using OpenQA.Selenium.Appium; @@ -15,8 +15,6 @@ public class SessionManager { private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; private static string[] FilesAppIDs = new string[]{ - "49306atecsolution.FilesUWP_dwm5abbcs5pn0!App", - "FilesDev_ykqwq8d6ps0ag!App", "FilesDev_dwm5abbcs5pn0!App", "FilesDev_9bhem8es8z4gp!App", }; From 14b45b6b63b32f5b659b1f135cae164c8156675b Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Thu, 9 Nov 2023 13:01:46 +0900 Subject: [PATCH 83/84] Update SessionManager.cs --- tests/Files.InteractionTests/SessionManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/Files.InteractionTests/SessionManager.cs b/tests/Files.InteractionTests/SessionManager.cs index 8066919387f4..cc8f47202ab1 100644 --- a/tests/Files.InteractionTests/SessionManager.cs +++ b/tests/Files.InteractionTests/SessionManager.cs @@ -15,6 +15,7 @@ public class SessionManager { private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; private static string[] FilesAppIDs = new string[]{ + "FilesDev_ykqwq8d6ps0ag!App", "FilesDev_dwm5abbcs5pn0!App", "FilesDev_9bhem8es8z4gp!App", }; From 92e632bc2565ce2b06711412825bb970ea2bfd64 Mon Sep 17 00:00:00 2001 From: 0x5bfa <62196528+0x5bfa@users.noreply.github.com> Date: Fri, 10 Nov 2023 13:15:16 +0900 Subject: [PATCH 84/84] Update SessionManager.cs --- tests/Files.InteractionTests/SessionManager.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/Files.InteractionTests/SessionManager.cs b/tests/Files.InteractionTests/SessionManager.cs index cc8f47202ab1..6341542eea4f 100644 --- a/tests/Files.InteractionTests/SessionManager.cs +++ b/tests/Files.InteractionTests/SessionManager.cs @@ -15,9 +15,9 @@ public class SessionManager { private const string WindowsApplicationDriverUrl = "http://127.0.0.1:4723"; private static string[] FilesAppIDs = new string[]{ - "FilesDev_ykqwq8d6ps0ag!App", - "FilesDev_dwm5abbcs5pn0!App", - "FilesDev_9bhem8es8z4gp!App", + "FilesDev_ykqwq8d6ps0ag!App", // Needed to run on the local end and/or the CI + "FilesDev_9bhem8es8z4gp!App", // Needed to run on the local end and/or the CI + "FilesDev_dwm5abbcs5pn0!App", // Needed to run on the CI }; private static uint appIdIndex = 0;