Files
LanMountainDesktop/.github/workflows/build.yml
lincube e8276c4d1e 0.2.7
修改天气组件,ci工作流
2026-03-04 02:02:34 +08:00

57 lines
1.8 KiB
YAML

name: Build & Test
on:
push:
branches: [ main, master, dev, develop ]
pull_request:
branches: [ main, master, dev, develop ]
workflow_dispatch:
env:
DOTNET_VERSION: '10.0.x'
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [ Debug, Release ]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
- name: Restore dependencies
run: dotnet restore
- name: Build LanMontainDesktop
run: dotnet build LanMontainDesktop/LanMontainDesktop.csproj -c ${{ matrix.configuration }} --no-restore
- name: Build RecommendationBackend
run: dotnet build LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj -c ${{ matrix.configuration }} --no-restore
- name: Test LanMontainDesktop
run: dotnet test LanMontainDesktop/LanMontainDesktop.csproj -c ${{ matrix.configuration }} --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" || true
- name: Test RecommendationBackend
run: dotnet test LanMontainDesktop.RecommendationBackend/LanMontainDesktop.RecommendationBackend.csproj -c ${{ matrix.configuration }} --no-build --verbosity normal --logger "trx;LogFileName=test-results.trx" || true
- name: Upload build artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: build-output-${{ matrix.configuration }}
path: |
LanMontainDesktop/bin/${{ matrix.configuration }}/
LanMontainDesktop.RecommendationBackend/bin/${{ matrix.configuration }}/
retention-days: 7