Skip to content

Fix CI validation and publish desktop artifacts #14

Fix CI validation and publish desktop artifacts

Fix CI validation and publish desktop artifacts #14

Workflow file for this run

name: CI
on:
push:
branches:
- main
- release/**
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- main
- release/**
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
STEP_TIMEOUT_MINUTES: 60
jobs:
quality:
name: Quality
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
timeout-minutes: 60
uses: "./.github/steps/install_dependencies"
- name: Format
shell: pwsh
run: dotnet format DotPilot.slnx --verify-no-changes
- name: Build
shell: pwsh
run: dotnet build DotPilot.slnx
- name: Analyze
shell: pwsh
run: dotnet build DotPilot.slnx -warnaserror
unit_tests:
name: Unit Tests
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
timeout-minutes: 60
uses: "./.github/steps/install_dependencies"
- name: Run Unit Tests
shell: pwsh
run: dotnet test ./DotPilot.Tests/DotPilot.Tests.csproj --logger GitHubActions --blame-crash
coverage:
name: Coverage
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
timeout-minutes: 60
uses: "./.github/steps/install_dependencies"
- name: Run Coverage
shell: pwsh
run: dotnet test ./DotPilot.Tests/DotPilot.Tests.csproj --settings ./DotPilot.Tests/coverlet.runsettings --logger GitHubActions --blame-crash --collect:"XPlat Code Coverage"
ui_tests:
name: UI Tests
runs-on: windows-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Dependencies
timeout-minutes: 60
uses: "./.github/steps/install_dependencies"
- name: Run UI Tests
shell: pwsh
run: dotnet test ./DotPilot.UITests/DotPilot.UITests.csproj --logger GitHubActions --blame-crash
desktop_artifacts:
name: Desktop Artifact (${{ matrix.name }})
runs-on: ${{ matrix.runner }}
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
include:
- name: macOS
runner: macos-latest
artifact_name: dotpilot-desktop-macos
output_path: artifacts/publish/macos
- name: Windows
runner: windows-latest
artifact_name: dotpilot-desktop-windows
output_path: artifacts/publish/windows
- name: Linux
runner: ubuntu-latest
artifact_name: dotpilot-desktop-linux
output_path: artifacts/publish/linux
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup .NET SDK from global.json
uses: actions/setup-dotnet@v4
with:
global-json-file: global.json
- name: Publish Desktop App
shell: pwsh
run: dotnet publish ./DotPilot/DotPilot.csproj -c Release -f net10.0-desktop -p:GenerateDocumentationFile=true -p:NoWarn=CS1591 -o ./${{ matrix.output_path }}
- name: Upload Desktop Artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ./${{ matrix.output_path }}
if-no-files-found: error
retention-days: 14