forked from kohsuke/com4j
-
Notifications
You must be signed in to change notification settings - Fork 2
63 lines (54 loc) · 2.07 KB
/
Copy pathbuild.yml
File metadata and controls
63 lines (54 loc) · 2.07 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
name: Build
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
build:
# windows-2022 ships Visual Studio 2022 (with the C++ ATL and MFC
# components the native build needs) and CMake preinstalled.
runs-on: windows-2022
steps:
- name: Check out repository (with submodules)
uses: actions/checkout@v7
with:
submodules: recursive
- name: Set up JDK
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: '17'
cache: maven
- name: Show build tool versions
shell: pwsh
run: |
cmake --version
java -version
# -DbuildNative=true forces a real rebuild instead of packaging the
# committed bin/ DLLs (JitPack's only option, since it can't run
# MSVC). package-only, run first, just to catch Release-only compile
# regressions before the Debug build below becomes the installed jar.
- name: Build native (Release)
shell: pwsh
run: mvn -B -pl "!test" package -DbuildNative=true -Dmode=Release
# TestObject (needed by tests) only compiles into Debug builds.
# install, not package, so "Run tests" below can resolve com4j from
# the local repo without rebuilding or needing -am.
- name: Build native (Debug)
shell: pwsh
run: mvn -B -pl "!test" install -DbuildNative=true -Dmode=Debug
# Registers com4j.dll as TestObject's COM server. Plain regsvr32
# works unelevated: GitHub's Windows runners run as Administrator
# with UAC disabled (actions/runner-images discussion #6557).
- name: Register COM test object
shell: pwsh
run: |
$dll = Resolve-Path "bin\x64\Debug\com4j.dll"
$p = Start-Process -FilePath "$env:SystemRoot\System32\regsvr32.exe" -ArgumentList "/s", "$dll" -Wait -PassThru -NoNewWindow
if ($p.ExitCode -ne 0) {
throw "regsvr32 failed with exit code $($p.ExitCode)"
}
- name: Run tests
shell: pwsh
run: mvn -B test -pl test