-
-
Notifications
You must be signed in to change notification settings - Fork 277
133 lines (111 loc) · 4.53 KB
/
autobuild.yml
File metadata and controls
133 lines (111 loc) · 4.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: CI Build
permissions:
contents: read
actions: read
checks: write
on:
push:
paths:
- 'Src/**'
- '.github/workflows/autobuild.yml'
jobs:
build:
name: 'Build'
runs-on: windows-2025-vs2026
timeout-minutes: 10
env:
DOTNET_NOLOGO: true
DOTNET_CLI_TELEMETRY_OPTOUT: true
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
with:
msbuild-architecture: x64 # default is x86
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
# Platform-specific IJW hosts from previous .NET SDKs are used when building C++/CLI projects.
dotnet-version: |
8.0.x
9.0.x
10.0.x
cache: true
cache-dependency-path: 'Src/*/packages.lock.json'
- name: Restore NuGet Packages
working-directory: Src
run: msbuild.exe DSInternals.slnx -target:Restore -property:RestorePackagesConfig=true -property:Configuration=Debug -property:Platform=x64
- name: Build x86
working-directory: Src
run: msbuild.exe DSInternals.ArchitectureSpecific.slnf -target:Build -property:Configuration=Debug -property:Platform=Win32 -property:RestorePackages=false
- name: Build ARM64
working-directory: Src
run: msbuild.exe DSInternals.ArchitectureSpecific.slnf -target:Build -property:Configuration=Debug -property:Platform=ARM64 -property:RestorePackages=false
- name: Build AMD64
working-directory: Src
run: msbuild.exe DSInternals.slnx -target:Build -property:Configuration=Debug -property:Platform=x64 -property:RestorePackages=false
- name: Create Module Catalog
shell: powershell
working-directory: Build/bin/DSInternals.PowerShell/Debug
run: New-FileCatalog -CatalogVersion 2 -Path DSInternals -CatalogFilePath .\DSInternals\DSInternals.cat
- name: Create Managed NuGet Packages
working-directory: Src
run: |
dotnet pack DSInternals.DotNetSdk.slnf --configuration Debug --no-build
- name: Create Mixed NuGet Package
working-directory: Src
run: |
msbuild.exe DSInternals.Replication -target:Pack -property:Configuration=Debug -property:Platform=x64 -property:RestorePackages=false -property:NoBuild=true -property:BuildProjectReferences=false
- name: Run Unit Tests
working-directory: Src
run: |
dotnet test --solution DSInternals.TestsOnly.slnf --configuration Debug --no-build -- --report-trx --results-directory "${{ github.workspace }}/TestResults"
- name: Run PowerShell Desktop Tests
working-directory: Scripts
shell: powershell
run: ./Invoke-SmokeTests.ps1 -Configuration 'Debug'
- name: Run PowerShell Core Tests
working-directory: Scripts
shell: pwsh
run: ./Invoke-SmokeTests.ps1 -Configuration 'Debug'
- name: Upload Test Results as Artifact
if: ${{ !cancelled() }}
uses: actions/upload-artifact@v6
with:
name: TestResults
path: TestResults/*
- name: Generate Unit Test Report
uses: dorny/test-reporter@v2
if: ${{ !cancelled() }}
with:
name: MSTest
reporter: dotnet-trx
path: TestResults/*.trx
use-actions-summary: true
badge-title: Unit Tests
- name: Get PowerShell Module Version
shell: pwsh
id: get-module-version
run: |
$version = (Test-ModuleManifest -Path ./Src/DSInternals.PowerShell/DSInternals.psd1 -ErrorAction SilentlyContinue).Version
echo "version=$version" >> $env:GITHUB_OUTPUT
- name: Upload PowerShell Module as Artifact
uses: actions/upload-artifact@v6
with:
name: DSInternals_v${{ steps.get-module-version.outputs.version }}_debug
path: Build/bin/DSInternals.PowerShell/Debug
- name: Upload NuGet Packages as Artifacts
uses: actions/upload-artifact@v6
with:
name: NuGet_v${{ steps.get-module-version.outputs.version }}_debug
path: Build/package/debug/*nupkg
- name: Create Chocolatey Package
shell: pwsh
run: |
choco pack Src/DSInternals.PowerShell/Chocolatey/dsinternals-psmodule.nuspec --version=${{ steps.get-module-version.outputs.version }} --output-directory=Build/package/Chocolatey --execution-timeout=60 --confirm configuration=Debug
- name: Upload Chocolatey Package as Artifact
uses: actions/upload-artifact@v6
with:
name: Chocolatey_v${{ steps.get-module-version.outputs.version }}_debug
path: Build/package/Chocolatey/*.nupkg