Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Commit 96a6967

Browse files
committed
Update workflows
1 parent d8ff8e3 commit 96a6967

File tree

2 files changed

+37
-17
lines changed

2 files changed

+37
-17
lines changed

.github/workflows/build.yml

Lines changed: 31 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,25 +40,44 @@ jobs:
4040
needs: Test-Scripts
4141
strategy:
4242
matrix:
43-
bitness: ['x86', 'x64']
43+
config: [x86, x64, x64-standalone]
44+
build-type: [system]
45+
include:
46+
- { config: x64-standalone, build-type: user }
4447
steps:
4548

4649
- name: Checkout
4750
uses: actions/checkout@v2
4851

49-
- name: Build ${{ matrix.bitness }}
52+
- name: Setup MSYS2
53+
uses: msys2/setup-msys2@v2
54+
55+
- name: Check OpenOCD repository
56+
shell: pwsh
57+
run: |
58+
$OpenOCDCommit = ((Get-Content .\config\repositories.json | ConvertFrom-Json).repositories | Where-Object { $_.href -like '*openocd.git' } | ForEach-Object { git ls-remote $_.href $_.tree }).Split("`t")[0]
59+
$Bitness = (Get-Content .\config\${{ matrix.config }}.json | ConvertFrom-Json).bitness
60+
Add-Content -Path $env:GITHUB_ENV -Value "OPENOCD_BUILD_ID=openocd-$OpenOCDCommit-$Bitness"
61+
62+
- name: Cache OpenOCD build
63+
uses: actions/cache@v3
64+
with:
65+
path: build/openocd-install
66+
key: ${{ env.OPENOCD_BUILD_ID }}
67+
68+
- name: Build ${{ matrix.config }} (${{ matrix.build-type }})
5069
shell: pwsh
5170
run: |
5271
Set-StrictMode -Version Latest
5372
$ErrorActionPreference = 'Stop'
5473
$ProgressPreference = 'SilentlyContinue'
5574
56-
.\build.ps1 .\config\${{ matrix.bitness }}.json -MSYS2Path C:\msys64
75+
.\build.ps1 .\config\${{ matrix.config }}.json -MSYS2Path (msys2 -c 'cygpath -m /').TrimEnd('\/') -SkipSigning -Compression zlib -BuildType ${{ matrix.build-type }}
5776
5877
- name: Upload build artifacts
5978
uses: actions/upload-artifact@v2
6079
with:
61-
name: Package-${{ matrix.bitness }}
80+
name: Package-${{ matrix.config }}-${{ matrix.build-type }}
6281
path: bin/
6382

6483
Test-Installer:
@@ -67,8 +86,11 @@ jobs:
6786
strategy:
6887
fail-fast: false
6988
matrix:
70-
bitness: ['x86', 'x64']
71-
winver: ['2019', '2022']
89+
winver: ['2022']
90+
config: [x64, x64-standalone]
91+
build-type: [system]
92+
include:
93+
- { winver: '2022', config: x64-standalone, build-type: user }
7294
steps:
7395

7496
- name: Checkout
@@ -77,10 +99,10 @@ jobs:
7799
- name: Download installer artifact
78100
uses: actions/download-artifact@v2
79101
with:
80-
name: Package-${{ matrix.bitness }}
102+
name: Package-${{ matrix.config }}-${{ matrix.build-type }}
81103
path: bin
82104

83-
- name: Test installer
105+
- name: Test ${{ matrix.config }} (${{ matrix.build-type }})
84106
shell: pwsh
85107
run: docker run --rm -v "$(Get-Location):C:\repo" mcr.microsoft.com/windows/servercore:ltsc${{ matrix.winver }}
86108
powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Command "cd C:\repo; .\tests\setup.ps1"
@@ -89,5 +111,5 @@ jobs:
89111
uses: actions/upload-artifact@v2
90112
if: ${{ always() }}
91113
with:
92-
name: Installer-Logs-Windows-${{ matrix.winver }}-${{ matrix.bitness }}
114+
name: Installer-Logs-Windows-${{ matrix.winver }}-${{ matrix.config }}-${{ matrix.build-type }}
93115
path: logs/

tests/setup.ps1

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,17 @@ Set-StrictMode -Version Latest
22
$ErrorActionPreference = 'Stop'
33
$ProgressPreference = 'SilentlyContinue'
44

5-
. "$PSScriptRoot\..\common.ps1"
6-
75
$installer = Get-ChildItem bin\*.exe | Select-Object -First 1 -ExpandProperty FullName
86
Write-Host "Starting $installer"
97
$elapsed = Measure-Command { Start-Process -FilePath $installer -ArgumentList "/S" -Wait }
108
Write-Host ("Finished in {0:hh':'mm':'ss}" -f $elapsed)
119

12-
$installPath = "$([Environment]::GetFolderPath("MyDocuments"))\Pico"
10+
$uninstRegKey = "Microsoft\Windows\CurrentVersion\Uninstall\Raspberry Pi Pico SDK*"
11+
$installPath = (Get-ItemProperty -Path "HKCU:\Software\$uninstRegKey", "HKLM:\Software\$uninstRegKey", "HKLM:\Software\WOW6432Node\$uninstRegKey" -Name InstallPath -ErrorAction SilentlyContinue).InstallPath
1312

14-
Write-Host "Copying logs"
15-
mkdirp logs
16-
Copy-Item $env:TEMP\dd_*.log .\logs
17-
Copy-Item "$installPath\install.log" .\logs
13+
# Write-Host "Copying logs"
14+
# New-Item -Path logs -Type Directory -Force | Out-Null
15+
# Copy-Item "$installPath\install.log" .\logs
1816

1917
# See: https://stackoverflow.com/a/22670892/12156188
2018
function Update-EnvironmentVariables {
@@ -31,4 +29,4 @@ function Update-EnvironmentVariables {
3129

3230
Update-EnvironmentVariables
3331

34-
exec { cmd /c call "$installPath\pico-setup.cmd" }
32+
cmd /c call "$installPath\pico-setup.cmd" "$([Environment]::GetFolderPath("MyDocuments"))\Pico"

0 commit comments

Comments
 (0)