4343 - { os: windows-latest, target: "windows", arch: "x64" }
4444 - { os: ubuntu-20.04, target: "linux", arch: "x64" }
4545 - { os: ubuntu-20.04, target: "linux", arch: "arm64" }
46- - { os: macos-latest, target: "macos", arch: "x64" }
47- - { os: macos-latest, target: "macos", arch: "arm64" }
48- node_ver : [ 16, 18, 19, 20, 21 ]
46+ - { os: macos-13, target: "macos", arch: "x64" }
47+ - { os: macos-14, target: "macos", arch: "arm64" }
48+ node_ver : [ 18, 20, 21, 22, 23 ]
4949 fail-fast : false
5050
5151 steps :
5757 submodules : ' recursive'
5858 # token: ${{ secrets.ZITI_CI_GH_TOKEN }}
5959
60+ - name : macOS tools
61+ if : runner.os == 'macOS'
62+ shell : bash
63+ run : brew install autoconf autoconf-archive automake pkg-config libtool
64+
6065 - name : Setup PkgConfig (Windows)
6166 if : matrix.config.target == 'windows'
6267 run : |
@@ -88,30 +93,34 @@ jobs:
8893 run : echo "date=$(date)" >> $GITHUB_OUTPUT
8994
9095 - name : Install CMake/Ninja
91- uses : lukka/get-cmake@v3.27.6
96+ uses : lukka/get-cmake@v3.30.1
9297
9398 - name : Run VCPKG
94- uses : lukka/run-vcpkg@v10
99+ uses : lukka/run-vcpkg@v11
100+ # will use baseline from vcpkg.json
95101 with :
96- vcpkgGitCommitId : ' c8696863d371ab7f46e213d8f5ca923c4aef2a00'
102+ # get baseline from vcpkg
103+ vcpkgJsonGlob : ' ./vcpkg.json'
97104
98- - name : gcc version
105+ - name : show versions
99106 run : |
107+ echo ===== gcc =====
100108 gcc --version
101- - name : cmake version
102- run : |
109+ echo ===== cmake =====
103110 cmake --version
104- - name : ninja version
105- run : |
106- ninja --version
107- - name : node version
108- run : |
109- node --version
110- - name : npm version
111- run : |
112- npm --version
111+ echo "ninja: $(ninja --version)"
112+ echo "node: $(node --version)"
113+ echo "npm: $(npm --version)"
114+
115+ - name : restore dependencies cache
116+ uses : actions/cache/restore@v4
117+ id : cache-restore
118+ with :
119+ key : deps-${{ matrix.config.target }}-${{ matrix.config.arch }}-${{ hashFiles('./vcpkg.json') }}
120+ path : ' ./vcpkg/packages'
113121
114122 - name : Build NodeJS-SDK
123+ id : buildSDK
115124 run : |
116125 cd ${{ runner.workspace }}/${{ github.event.repository.name }}
117126 npm install
@@ -121,11 +130,33 @@ jobs:
121130 TARGET_ARCH : ${{ matrix.config.arch }}
122131 BUILD_DATE : ${{ steps.date.outputs.date }}
123132
133+ - name : show build result
134+ if : always()
135+ run : echo build result ${{ steps.buildSDK.outcome }}
136+
137+ - name : debug build failure
138+ if : always() && steps.buildSDK.outcome == 'failure'
139+ uses : actions/upload-artifact@v3
140+ with :
141+ name : build-logs-${{ matrix.config.target }}-${{ matrix.config.arch }}
142+ path : |
143+ ./vcpkg/buildtrees/**/*.log
144+ ./build/**/*log
145+
124146 - name : Hello test
125147 if : matrix.config.arch == 'x64'
126148 run : |
127149 node tests/hello.js
128150
151+ - name : save dependencies cache
152+ uses : actions/cache/save@v4
153+ id : cache-save
154+ # save deps even build has failed
155+ if : always()
156+ with :
157+ key : ${{ steps.cache-restore.outputs.cache-primary-key }}
158+ path : ' ./vcpkg/packages'
159+
129160 - name : upload artifacts
130161 uses : actions/upload-artifact@v3
131162 with :
0 commit comments