Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub: Added build CI #13620

Merged
merged 87 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from 85 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
eea0fb2
GitHub: Preview deploy action
yaira2 Oct 30, 2023
6d050f8
Add build CI
0x5bfa Oct 31, 2023
479f3b5
Update
0x5bfa Oct 31, 2023
a73693d
Update build-dev.yml
0x5bfa Oct 31, 2023
177ac00
Update
0x5bfa Nov 1, 2023
5cf469c
Fix
0x5bfa Nov 1, 2023
4b9cfeb
Update
0x5bfa Nov 1, 2023
bb5689e
Fix
0x5bfa Nov 1, 2023
038248c
Update
0x5bfa Nov 1, 2023
7e52558
Fix
0x5bfa Nov 1, 2023
1476a72
Update
0x5bfa Nov 1, 2023
8ab0a44
Update
0x5bfa Nov 1, 2023
c9d8b7b
Update
0x5bfa Nov 1, 2023
f9a00f5
Update
0x5bfa Nov 1, 2023
73a879a
Update
0x5bfa Nov 1, 2023
2abe1eb
Fix
0x5bfa Nov 1, 2023
182e84d
Update
0x5bfa Nov 1, 2023
2da0d28
Update
0x5bfa Nov 1, 2023
ed0dda7
Update
0x5bfa Nov 1, 2023
e0ad035
Update
0x5bfa Nov 1, 2023
9aac979
Update
0x5bfa Nov 1, 2023
ba86aef
Update
0x5bfa Nov 1, 2023
1b72a15
Update
0x5bfa Nov 1, 2023
e159d2f
Update
0x5bfa Nov 1, 2023
094ba03
Update
0x5bfa Nov 1, 2023
0e9a22b
Update
0x5bfa Nov 1, 2023
7888074
Update
0x5bfa Nov 1, 2023
0599c20
Update actions to start WinAppDriver, add second app id to find app
marcelwgn Nov 2, 2023
7a351d2
Delete builds/azure-pipelines.yml
0x5bfa Nov 2, 2023
bb9ba6e
Update and rename build-app.yml to ci.yml
0x5bfa Nov 2, 2023
3b375e4
Merge branch 'main' into 5bfa/Add-DevCIActions
0x5bfa Nov 3, 2023
190c288
Merge branch 'main' into 5bfa/Add-DevCIActions
0x5bfa Nov 4, 2023
30ef09b
Update .github/workflows/ci.yml
0x5bfa Nov 5, 2023
ff3291e
Update
0x5bfa Nov 5, 2023
f9c8c1d
Update
0x5bfa Nov 5, 2023
4c12684
Update
0x5bfa Nov 5, 2023
3e7222b
Update
0x5bfa Nov 5, 2023
f53d75e
Fix if statement
0x5bfa Nov 5, 2023
81eef00
Update
0x5bfa Nov 5, 2023
f371ff0
Updated
0x5bfa Nov 5, 2023
32a292b
Update
0x5bfa Nov 5, 2023
91bdbd7
Update
0x5bfa Nov 5, 2023
0b4f060
Update
0x5bfa Nov 5, 2023
fe2f5ab
Update
0x5bfa Nov 5, 2023
ed95c75
Update
0x5bfa Nov 5, 2023
98a14b2
Update
0x5bfa Nov 5, 2023
f4a8293
Update
0x5bfa Nov 5, 2023
962c15f
Update ci.yml
0x5bfa Nov 5, 2023
fe74185
Update ci.yml
0x5bfa Nov 6, 2023
2134186
Update
0x5bfa Nov 6, 2023
8dc815d
Update to run WinAppDriver :(
0x5bfa Nov 6, 2023
d6782a3
Update
0x5bfa Nov 6, 2023
64acb6d
Update
0x5bfa Nov 6, 2023
28f1595
Update
0x5bfa Nov 6, 2023
7182f95
Fix
0x5bfa Nov 6, 2023
0b89262
Fix
0x5bfa Nov 6, 2023
468c647
Update
0x5bfa Nov 6, 2023
a296850
Update
0x5bfa Nov 6, 2023
384624f
Update Convert-TrxToMarkdown.ps1
0x5bfa Nov 6, 2023
f92cccb
Update ci.yml
0x5bfa Nov 6, 2023
822fd93
Update
0x5bfa Nov 6, 2023
f28680e
merge
0x5bfa Nov 6, 2023
00cb8f0
Done
0x5bfa Nov 7, 2023
04b0754
Remove annotations
0x5bfa Nov 7, 2023
a8bcb29
Supress warnings
0x5bfa Nov 7, 2023
cb35cbd
Remove annotations 2
0x5bfa Nov 7, 2023
6d627b0
Fix conditional job running
0x5bfa Nov 7, 2023
87494dc
Update
0x5bfa Nov 7, 2023
320d6fe
Fixed tool name
0x5bfa Nov 7, 2023
b675fc8
Update
0x5bfa Nov 7, 2023
a9ed8dc
Fix
0x5bfa Nov 7, 2023
b8e730c
Update
0x5bfa Nov 7, 2023
2405f72
Fix
0x5bfa Nov 7, 2023
69f6003
Update
0x5bfa Nov 7, 2023
10b0f80
Update
0x5bfa Nov 7, 2023
ed3b54e
Switch to self sign script
marcelwgn Nov 7, 2023
a603ea4
Add additional app identity
marcelwgn Nov 7, 2023
53e441c
Delete .github/workflows/check-xaml-formatting.yml
0x5bfa Nov 8, 2023
35b26e9
Update ci.yml
0x5bfa Nov 8, 2023
d5ec8d6
Update
0x5bfa Nov 8, 2023
d2f87ad
Update
0x5bfa Nov 8, 2023
184d1dd
Updated
0x5bfa Nov 8, 2023
8a406d2
Update
0x5bfa Nov 8, 2023
ad1a7b1
Fix
0x5bfa Nov 8, 2023
3684adf
Update SessionManager.cs
0x5bfa Nov 8, 2023
14b45b6
Update SessionManager.cs
0x5bfa Nov 9, 2023
92e632b
Update SessionManager.cs
0x5bfa Nov 10, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .github/workflows/check-xaml-formatting.yml

This file was deleted.

241 changes: 241 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,241 @@
# Copyright (c) 2023 Files Community
# Licensed under the MIT License. See the LICENSE.

# Abstract:
# - This CI is executed when a new commit is created on the main branch or
# on a PR whose head branch is the main branch.
# - However, the CI will not be executed if files not directly related to
# source code maintenance are updated.

name: Files CI

on:
push:
branches:
- main
paths-ignore:
- 'specs/**'
- '*.md'
pull_request:
paths-ignore:
- 'specs/**'
- '*.md'

run-name: ${{ github.event_name == 'pull_request' && 'Files PR Validation' || 'Files CI Validation' }}

env:
WORKING_DIR: ${{ github.workspace }} # Default: 'D:\a\Files\Files'
SOLUTION_PATH: '${{ github.workspace }}\Files.sln'
PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\Files.App (Package)'
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\Files.App (Package)\Files.Package.wapproj'
AUTOMATED_TESTS_ARCHITECTURE: 'x64'
AUTOMATED_TESTS_CONFIGURATION: 'Release'
AUTOMATED_TESTS_PROJECT_DIR: '${{ github.workspace }}\tests\Files.InteractionTests'
AUTOMATED_TESTS_PROJECT_PATH: '${{ github.workspace }}\tests\Files.InteractionTests\Files.InteractionTests.csproj'
AUTOMATED_TESTS_ASSEMBLY_DIR: '${{ github.workspace }}\artifacts\TestsAssembly'
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts'
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages'
APPX_SELFSIGNED_CERT_PATH: '${{ github.workspace }}\.github\workflows\FilesApp_SelfSigned.pfx'
WINAPPDRIVER_EXE86_PATH: 'C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe'
WINAPPDRIVER_EXE64_PATH: 'C:\Program Files\Windows Application Driver\WinAppDriver.exe'

jobs:

check-formatting:
runs-on: ubuntu-latest
defaults:
run:
shell: pwsh

steps:

- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 2

- name: Install XamlStyler console
run: 'dotnet tool install --global XamlStyler.Console'

- name: Check XAML formatting
id: check-step
run: |
$changedFiles = (git diff --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"}
foreach ($file in $changedFiles)
{
xstyler -p -l None -f $file
if ($LASTEXITCODE -ne 0)
{
echo "::error file=$file::Format check failed"
}
}
continue-on-error: true

- name: Fail the job if the XamlStyler found unformatted file(s)
if: steps.check-step.outcome == 'failure'
run: exit 1

build:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Debug, Release]
platform: [x64, arm64]
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.platform }}

steps:

- name: Checkout the repository
uses: actions/checkout@v3

- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1

- name: Setup NuGet
uses: NuGet/[email protected]

- name: Setup .NET 7
0x5bfa marked this conversation as resolved.
Show resolved Hide resolved
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.0.x'

- name: Restore NuGet
shell: pwsh
run: 'nuget restore $env:SOLUTION_PATH'

- name: Restore Files
shell: pwsh
run: |
msbuild $env:SOLUTION_PATH `
-t:Restore `
-p:Platform=$env:ARCHITECTURE `
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true

- if: env.CONFIGURATION != env.AUTOMATED_TESTS_CONFIGURATION || env.ARCHITECTURE != env.AUTOMATED_TESTS_ARCHITECTURE
name: Build Files
run: |
msbuild `
$env:PACKAGE_PROJECT_PATH `
-t:Build `
-clp:ErrorsOnly `
-p:Configuration=$env:CONFIGURATION `
-p:Platform=$env:ARCHITECTURE `
-p:AppxBundle=Never

- if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE
name: Create self signed cert as a pfx file
run: ./scripts/Generate-SelfCertPfx.ps1 -Destination "$env:APPX_SELFSIGNED_CERT_PATH"

- if: env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION && env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE
name: Build & package Files
run: |
msbuild `
$env:PACKAGE_PROJECT_PATH `
-t:Build `
-t:_GenerateAppxPackage `
-clp:ErrorsOnly `
-p:Configuration=$env:CONFIGURATION `
-p:Platform=$env:ARCHITECTURE `
-p:AppxBundlePlatforms=$env:AUTOMATED_TESTS_ARCHITECTURE `
-p:AppxBundle=Always `
-p:UapAppxPackageBuildMode=SideloadOnly `
-p:AppxPackageDir=$env:APPX_PACKAGE_DIR `
-p:AppxPackageSigningEnabled=true `
-p:PackageCertificateKeyFile=$env:APPX_SELFSIGNED_CERT_PATH `
-p:PackageCertificatePassword="" `
-p:PackageCertificateThumbprint=""

- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION
name: Build interaction tests
run: |
msbuild $env:AUTOMATED_TESTS_PROJECT_PATH `
-t:Build `
-clp:ErrorsOnly `
-p:Configuration=$env:CONFIGURATION `
-p:Platform=$env:AUTOMATED_TESTS_ARCHITECTURE

- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION
name: Copy tests bin to the artifacts dir
shell: pwsh
run: |
Copy-Item `
-Path "$env:AUTOMATED_TESTS_PROJECT_DIR\bin" `
-Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR" -Recurse

- if: env.ARCHITECTURE == env.AUTOMATED_TESTS_ARCHITECTURE && env.CONFIGURATION == env.AUTOMATED_TESTS_CONFIGURATION
name: Upload the packages to the Artifacts
uses: actions/upload-artifact@v3
with:
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})'
path: ${{ env.ARTIFACTS_STAGING_DIR }}

test:
needs: [build]
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
configuration: [Release]
platform: [x64]
yaira2 marked this conversation as resolved.
Show resolved Hide resolved
env:
CONFIGURATION: ${{ matrix.configuration }}
permissions:
contents: read
pull-requests: write

steps:

- name: Checkout the repository
uses: actions/checkout@v3

- name: Download the packages from the Artifacts
uses: actions/download-artifact@v3
with:
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.AUTOMATED_TESTS_ARCHITECTURE }})'
path: ${{ env.ARTIFACTS_STAGING_DIR }}

- name: Install Files
shell: powershell
run: |
Set-Location "$env:APPX_PACKAGE_DIR"
$AppxPackageBundleDir = Get-ChildItem -Filter Files.Package_*_Test -Name
Set-Location $AppxPackageBundleDir
./Install.ps1 -Force
Get-AppxPackage

- name: Set full HD resolution
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force

- name: Start WinAppDriver process
shell: pwsh
run: Start-Process -FilePath "$env:WINAPPDRIVER_EXE86_PATH"

- name: Run interaction tests
run: |
dotnet test `
$env:AUTOMATED_TESTS_ASSEMBLY_DIR\**\Files.InteractionTests.dll `
--logger "trx;LogFileName=$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx"

# - name: Generate markdown from the tests result
# shell: pwsh
# run: |
# . './scripts/Convert-TrxToMarkdown.ps1' `
# -Source "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.trx" `
# -Destination "$env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md"
# env:
# PULL_REQUEST_ID: ${{ github.event.pull_request_id }}

# - name: Display the markdown on the output (temp)
# shell: pwsh
# run: |
# Get-Content $env:AUTOMATED_TESTS_ASSEMBLY_DIR\testResults.md

# - name: Publish tests result
# uses: marocchino/sticky-pull-request-comment@v2
# with:
# header: test-result
# path: '${{ env.AUTOMATED_TESTS_ASSEMBLY_DIR }}\testResults.md'
Binary file removed builds/Files_SelfSigned.pfx
Binary file not shown.
Loading
Loading