Skip to content

Commit 57e3b88

Browse files
github workflow files for CI
1 parent 43eb98c commit 57e3b88

File tree

4 files changed

+56
-27
lines changed

4 files changed

+56
-27
lines changed

.github/workflows/build-arch-emu.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ jobs:
5858
run: lscpu
5959

6060
- name: checkout repository
61-
uses: actions/checkout@v3
61+
uses: actions/checkout@v4
6262
# shell: bash
6363

6464
- name: install dependencies
@@ -94,7 +94,7 @@ jobs:
9494
9595
- name: restore ccache
9696
# setup the GitHub cache used to maintain the ccache from one job to the next
97-
uses: actions/cache/restore@v3
97+
uses: actions/cache/restore@v4
9898
with:
9999
# location of the ccache of the chroot in the root file system
100100
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
@@ -164,7 +164,7 @@ jobs:
164164
- name: save ccache
165165
# Save the cache after we are done (successfully) building
166166
# This helps to retain the ccache even if the subsequent steps are failing.
167-
uses: actions/cache/save@v3
167+
uses: actions/cache/save@v4
168168
with:
169169
path: /home/runner/rootfs/alpine-latest-${{ matrix.arch }}/home/runner/.ccache
170170
key: ${{ steps.ccache-prepare.outputs.key }}

.github/workflows/build.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ jobs:
9494
run: lscpu
9595

9696
- name: checkout repository
97-
uses: actions/checkout@v3
97+
uses: actions/checkout@v4
9898

9999
- name: install dependencies
100100
env:
@@ -115,7 +115,7 @@ jobs:
115115
116116
- name: restore ccache
117117
# setup the GitHub cache used to maintain the ccache from one job to the next
118-
uses: actions/cache/restore@v3
118+
uses: actions/cache/restore@v4
119119
with:
120120
path: ~/.ccache
121121
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -192,7 +192,7 @@ jobs:
192192
- name: save ccache
193193
# Save the cache after we are done (successfully) building
194194
# This helps to retain the ccache even if the subsequent steps are failing.
195-
uses: actions/cache/save@v3
195+
uses: actions/cache/save@v4
196196
with:
197197
path: ~/.ccache
198198
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -348,7 +348,7 @@ jobs:
348348
msystem: ${{ matrix.msystem }}
349349

350350
- name: checkout repository
351-
uses: actions/checkout@v3
351+
uses: actions/checkout@v4
352352

353353
- name: prepare ccache
354354
# create key with human readable timestamp
@@ -360,7 +360,7 @@ jobs:
360360
361361
- name: restore ccache
362362
# Setup the GitHub cache used to maintain the ccache from one job to the next
363-
uses: actions/cache/restore@v3
363+
uses: actions/cache/restore@v4
364364
with:
365365
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
366366
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -425,7 +425,7 @@ jobs:
425425
- name: save ccache
426426
# Save the cache after we are done (successfully) building
427427
# This helps to retain the ccache even if the subsequent steps are failing.
428-
uses: actions/cache/save@v3
428+
uses: actions/cache/save@v4
429429
with:
430430
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
431431
key: ${{ steps.ccache-prepare.outputs.key }}

.github/workflows/macos.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
sysctl machdep
3636
3737
- name: checkout repository
38-
uses: actions/checkout@v3
38+
uses: actions/checkout@v4
3939

4040
- name: install dependencies
4141
# Homebrew's Python conflicts with the Python that comes pre-installed
@@ -61,7 +61,7 @@ jobs:
6161
6262
- name: restore ccache
6363
# setup the GitHub cache used to maintain the ccache from one job to the next
64-
uses: actions/cache/restore@v3
64+
uses: actions/cache/restore@v4
6565
with:
6666
path: /Users/runner/Library/Caches/ccache
6767
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -192,7 +192,7 @@ jobs:
192192
- name: save ccache
193193
# Save the cache after we are done (successfully) building
194194
# This helps to retain the ccache even if the subsequent steps are failing.
195-
uses: actions/cache/save@v3
195+
uses: actions/cache/save@v4
196196
with:
197197
path: /Users/runner/Library/Caches/ccache
198198
key: ${{ steps.ccache-prepare.outputs.key }}

.github/workflows/root-cmakelists.yaml

Lines changed: 44 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
run: lscpu
8181

8282
- name: checkout repository
83-
uses: actions/checkout@v3
83+
uses: actions/checkout@v4
8484

8585
- name: install dependencies
8686
env:
@@ -101,7 +101,7 @@ jobs:
101101
102102
- name: restore ccache
103103
# setup the GitHub cache used to maintain the ccache from one job to the next
104-
uses: actions/cache/restore@v3
104+
uses: actions/cache/restore@v4
105105
with:
106106
path: ~/.ccache
107107
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -135,6 +135,22 @@ jobs:
135135
ccache -s
136136
echo "/usr/lib/ccache" >> $GITHUB_PATH
137137
138+
- name: check auto-dependency resolution
139+
# no need to check this with all runners. One is enough.
140+
if: ${{ matrix.cc == 'gcc' && matrix.cuda == 'without' }}
141+
run: |
142+
mkdir -p ${GITHUB_WORKSPACE}/build-dep && cd ${GITHUB_WORKSPACE}/build-dep
143+
IFS=':' read -r -a libs <<< "${INSTALLED_LIBS}"
144+
for lib in "${libs[@]}"; do
145+
printf "::group:: \033[0;32m==>\033[0m Configuring to build only \033[0;32m${lib}\033[0m\n"
146+
cmake --fresh \
147+
-DCMAKE_BUILD_TYPE="Release" \
148+
-DBLA_VENDOR="OpenBLAS" \
149+
-DSUITESPARSE_ENABLE_PROJECTS="${lib,,}" \
150+
..
151+
echo "::endgroup::"
152+
done
153+
138154
- name: configure
139155
run: |
140156
mkdir -p ${GITHUB_WORKSPACE}/build && cd ${GITHUB_WORKSPACE}/build
@@ -174,7 +190,7 @@ jobs:
174190
- name: save ccache
175191
# Save the cache after we are done (successfully) building.
176192
# This helps to retain the ccache even if the subsequent steps are failing.
177-
uses: actions/cache/save@v3
193+
uses: actions/cache/save@v4
178194
with:
179195
path: ~/.ccache
180196
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -273,7 +289,7 @@ jobs:
273289
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
274290
runs-on: windows-latest
275291

276-
name: msvc (${{ matrix.openmp }} OpenMP ${{ matrix.cuda }} CUDA, ${{ matrix.link }})
292+
name: msvc (${{ matrix.cc }} ${{ matrix.openmp }} OpenMP ${{ matrix.cuda }} CUDA, ${{ matrix.link }})
277293

278294
defaults:
279295
run:
@@ -288,6 +304,7 @@ jobs:
288304
openmp: [with, without]
289305
cuda: [without]
290306
link: [both]
307+
cc: [cl]
291308
include:
292309
- openmp: without
293310
openmp-cmake-flags: "-DSUITESPARSE_USE_OPENMP=OFF"
@@ -297,6 +314,7 @@ jobs:
297314
-DSUITESPARSE_USE_CUDA=ON
298315
-DCMAKE_CUDA_COMPILER_LAUNCHER="ccache"
299316
link: both
317+
cc: cl
300318
- openmp: with
301319
cuda: with
302320
cuda-cmake-flags:
@@ -306,6 +324,11 @@ jobs:
306324
link-cmake-flags:
307325
-DBUILD_SHARED_LIBS=OFF
308326
-DBUILD_STATIC_LIBS=ON
327+
cc: cl
328+
- openmp: with
329+
cuda: without
330+
link: both
331+
cc: clang-cl
309332

310333
env:
311334
CHERE_INVOKING: 1
@@ -317,15 +340,15 @@ jobs:
317340
Get-CIMInstance -Class Win32_Processor | Select-Object -Property Name
318341
319342
- name: checkout repository
320-
uses: actions/checkout@v3
343+
uses: actions/checkout@v4
321344

322-
- uses: conda-incubator/setup-miniconda@v2
345+
- uses: conda-incubator/setup-miniconda@v3
323346
with:
324347
auto-update-conda: true
325348

326349
- name: cache conda packages
327350
id: conda-cache
328-
uses: actions/cache/restore@v3
351+
uses: actions/cache/restore@v4
329352
with:
330353
path: C:/Miniconda/envs/test
331354
key: conda:msvc
@@ -361,7 +384,7 @@ jobs:
361384
362385
msystem: UCRT64
363386

364-
- uses: Jimver/cuda-toolkit@v0.2.11
387+
- uses: Jimver/cuda-toolkit@v0.2.14
365388
name: install CUDA toolkit
366389
if: matrix.cuda == 'with'
367390
id: cuda-toolkit
@@ -401,18 +424,18 @@ jobs:
401424
shell: msys2 {0}
402425
run: |
403426
echo "ccachedir=$(cygpath -m $(${CCACHE} -k cache_dir))" >> $GITHUB_OUTPUT
404-
echo "key=ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
427+
echo "key=ccache:msvc:root:${{ matrix.cc }}:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:${{ github.ref }}:$(date +"%Y-%m-%d_%H-%M-%S"):${{ github.sha }}" >> $GITHUB_OUTPUT
405428
406429
- name: restore ccache
407430
# Setup the GitHub cache used to maintain the ccache from one job to the next
408-
uses: actions/cache/restore@v3
431+
uses: actions/cache/restore@v4
409432
with:
410433
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
411434
key: ${{ steps.ccache-prepare.outputs.key }}
412435
# Prefer caches from the same branch. Fall back to caches from the dev branch.
413436
restore-keys: |
414-
ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:${{ github.ref }}
415-
ccache:msvc:root:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:
437+
ccache:msvc:root:${{ matrix.cc }}:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:${{ github.ref }}
438+
ccache:msvc:root:${{ matrix.cc }}:${{ matrix.openmp }}:${{ matrix.cuda }}:${{ matrix.link }}:
416439
417440
- name: configure ccache
418441
# Limit the maximum size and switch on compression to avoid exceeding the total disk or cache quota.
@@ -435,6 +458,8 @@ jobs:
435458
fi
436459
mkdir -p ${GITHUB_WORKSPACE}/build && cd ${GITHUB_WORKSPACE}/build
437460
cmake -G"Ninja Multi-Config" \
461+
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
462+
-DCMAKE_CXX_COMPILER=${{ matrix.cc }} \
438463
-DCMAKE_BUILD_TYPE="Release" \
439464
-DCMAKE_INSTALL_PREFIX=".." \
440465
-DCMAKE_PREFIX_PATH="C:/Miniconda/envs/test/Library;${GITHUB_WORKSPACE}/dependencies" \
@@ -476,7 +501,7 @@ jobs:
476501
- name: save ccache
477502
# Save the cache after we are done (successfully) building
478503
# This helps to retain the ccache even if the subsequent steps are failing.
479-
uses: actions/cache/save@v3
504+
uses: actions/cache/save@v4
480505
with:
481506
path: ${{ steps.ccache-prepare.outputs.ccachedir }}
482507
key: ${{ steps.ccache-prepare.outputs.key }}
@@ -497,7 +522,9 @@ jobs:
497522
run: |
498523
cd ${GITHUB_WORKSPACE}/Example/build
499524
printf "::group::\033[0;32m==>\033[0m Configuring example\n"
500-
cmake \
525+
cmake -G"Ninja Multi-Config" \
526+
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
527+
-DCMAKE_CXX_COMPILER=${{ matrix.cc }} \
501528
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake;C:/Miniconda/envs/test/Library;${GITHUB_WORKSPACE}/dependencies" \
502529
-DBLA_VENDOR="All" \
503530
${{ matrix.openmp-cmake-flags }} \
@@ -533,7 +560,9 @@ jobs:
533560
printf "::group:: \033[0;32m==>\033[0m Building with Config.cmake with library \033[0;32m${lib}\033[0m\n"
534561
cd ${GITHUB_WORKSPACE}/TestConfig/${lib}
535562
cd build
536-
cmake \
563+
cmake -G"Ninja Multi-Config" \
564+
-DCMAKE_C_COMPILER=${{ matrix.cc }} \
565+
-DCMAKE_CXX_COMPILER=${{ matrix.cc }} \
537566
-DCMAKE_PREFIX_PATH="${GITHUB_WORKSPACE}/lib/cmake;C:/Miniconda/envs/test/Library;${GITHUB_WORKSPACE}/dependencies" \
538567
..
539568
cmake --build . --config Release

0 commit comments

Comments
 (0)