GitHub: Added build CI #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' | |
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] | |
env: | |
CONFIGURATION: ${{ matrix.configuration }} | |
PLATFORM: ${{ matrix.platform }} | |
APPX_BUNDLE_PLATFORMS: ${{ 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 | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: '7.0.x' | |
- name: Restore NuGet | |
shell: pwsh | |
run: 'nuget restore $env:SOLUTION_NAME' | |
- name: Restore Files | |
shell: pwsh | |
run: | | |
msbuild $env:SOLUTION_NAME ` | |
-t:Restore ` | |
-p:Platform=$env:PLATFORM ` | |
-p:Configuration=$env:CONFIGURATION ` | |
-p:PublishReadyToRun=true | |
- name: Build & Publish Files | |
run: | | |
msbuild $env:SOLUTION_NAME ` | |
-t:Build ` | |
-t:_GenerateAppxPackage ` | |
-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: 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: | | |
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 |