-
Notifications
You must be signed in to change notification settings - Fork 34
124 lines (104 loc) · 3.69 KB
/
build.yml
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
name: Build
on: [push, pull_request]
jobs:
Test-Scripts:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Test scripts
shell: pwsh
run: |
$pesterConfig = @{
Run = @{
Path = ".\tests\common.Tests.ps1"
Exit = $true
}
TestResult = @{
Enabled = $true
OutputPath = "testResults.xml"
OutputFormat = "NUnitXML"
}
Output = @{
Verbosity = "Detailed"
}
}
Invoke-Pester -Configuration $pesterConfig
- name: Upload test results
uses: actions/upload-artifact@v4
with:
name: Pester-Test-Results
path: testResults.xml
Build:
runs-on: windows-latest
needs: Test-Scripts
strategy:
fail-fast: false
matrix:
config: [x64, x64-standalone]
build-type: [system]
include:
- { config: x64-standalone, build-type: user }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup MSYS2
uses: msys2/setup-msys2@v2
- name: Check OpenOCD repository
shell: pwsh
run: .\packages\common\build-id.ps1 openocd .\config\${{ matrix.config }}.json >> $env:GITHUB_ENV
- name: Cache OpenOCD build
uses: actions/cache@v4
with:
path: build/openocd-install
key: ${{ env.OPENOCD_BUILD_ID }}
- name: Check riscv-gnu-toolchain repository
shell: pwsh
run: .\packages\common\build-id.ps1 riscv-gnu-toolchain .\config\${{ matrix.config }}.json >> $env:GITHUB_ENV
- name: Cache riscv-gnu-toolchain build
uses: actions/cache@v4
with:
path: build/riscv-gnu-toolchain-install
key: ${{ env.RISCV-GNU-TOOLCHAIN_BUILD_ID }}
- name: Build ${{ matrix.config }} (${{ matrix.build-type }})
shell: pwsh
run: |
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
subst P: .
P:
.\build.ps1 .\config\${{ matrix.config }}.json -MSYS2Path (msys2 -c 'cygpath -m /').TrimEnd('\/') -SkipSigning -Compression zlib -BuildType ${{ matrix.build-type }}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: Package-${{ matrix.config }}-${{ matrix.build-type }}
path: bin/
Test-Installer:
runs-on: windows-${{ matrix.winver }}
needs: Build
strategy:
fail-fast: false
matrix:
winver: ['2022']
config: [x64, x64-standalone]
build-type: [system]
include:
- { winver: '2022', config: x64-standalone, build-type: user }
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download installer artifact
uses: actions/download-artifact@v4
with:
name: Package-${{ matrix.config }}-${{ matrix.build-type }}
path: bin
- name: Test ${{ matrix.config }} (${{ matrix.build-type }})
shell: pwsh
run: docker run --rm -v "$(Get-Location):C:\repo" mcr.microsoft.com/windows/servercore:ltsc${{ matrix.winver }}
powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "cd C:\repo; .\tests\setup.ps1"
- name: Upload installer logs
uses: actions/upload-artifact@v4
with:
name: Installer-Logs-Windows-${{ matrix.winver }}-${{ matrix.config }}-${{ matrix.build-type }}
path: logs/