4040 strategy :
4141 matrix :
4242 os : [ubuntu-20.04, ubuntu-22.04]
43- env :
44- CCACHE_DIR : /home/runner/.ccache
45- CCACHE_MAXSIZE : 500M
4643
4744 steps :
4845 - uses : actions/checkout@v4
5350 sudo apt update
5451 # TTK dependencies
5552 sudo apt install -y \
56- ccache \
53+ cargo \
5754 libboost-system-dev \
5855 libeigen3-dev \
5956 libgraphviz-dev \
6764 libqhull-dev \
6865 dpkg-dev
6966 sudo python3 -m pip install scikit-learn
67+ cargo install sccache --version 0.4.2 --locked
68+ echo "PATH=/root/.cargo/bin:$PATH" >> $GITHUB_ENV
69+
70+ - name : Install and setup sccache
71+ uses : f3d-app/sccache-setup-action@v1
72+ with :
73+ key : ${{ matrix.os }}-0
7074
7175 - name : Install optional dependencies
7276 uses : ./.github/actions/install-deps-unix
7983 unzip libtorch-cxx11-abi-shared-with-deps-2.3.1+cpu.zip
8084 sudo cp -R libtorch/* /usr/local/
8185
82- - name : Fetch archived ccache
83- continue-on-error : true
84- run : |
85- wget -O ttk-ccache.tar.gz \
86- https://github.com/topology-tool-kit/ttk/releases/download/ccache/ttk-ccache-${{ matrix.os }}.tar.gz
87-
88- - name : Decompress ccache archive
89- continue-on-error : true
90- run : |
91- tar xzf ttk-ccache.tar.gz
92- mv .ccache /home/runner/
93-
9486 - name : Fetch TTK-ParaView headless Debian package
9587 run : |
9688 wget -O ttk-paraview-headless.deb \
10698 cd build
10799 cmake \
108100 -DCMAKE_BUILD_TYPE=Release \
109- -DCMAKE_C_COMPILER_LAUNCHER=ccache \
110- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
101+ -DCMAKE_C_COMPILER_LAUNCHER=sccache \
102+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
111103 -DCMAKE_INSTALL_PREFIX=/usr \
112104 -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
113105 -DTTK_BUILD_VTK_WRAPPERS=TRUE \
@@ -130,6 +122,10 @@ jobs:
130122 cpack -G DEB
131123 sudo cmake --build . --target install
132124
125+ - name : Show sccache results
126+ shell : bash
127+ run : sccache --show-stats
128+
133129 - name : Run TTK tests
134130 uses : ./.github/actions/test-ttk-unix
135131
@@ -139,22 +135,6 @@ jobs:
139135 name : ttk-for-tests-${{ matrix.os }}.deb
140136 path : build/ttk.deb
141137
142- - name : Archive cache
143- run : |
144- ccache -s
145- ccache -c
146- cd /home/runner
147- tar czf ttk-ccache.tar.gz .ccache
148-
149- - name : Upload ccache archive
150- if : ${{ github.repository_owner == 'topology-tool-kit' && contains(github.ref, 'heads') }}
151- uses : actions/upload-artifact@v4
152- with :
153- name : ttk-ccache-${{ matrix.os }}
154- path : /home/runner/ttk-ccache.tar.gz
155- retention-days : 2
156-
157-
158138 # ------------------#
159139 # Tests on ttk-data #
160140 # ------------------#
@@ -279,9 +259,7 @@ jobs:
279259 test-build-macos :
280260 runs-on : macos-12
281261 if : ${{ github.repository_owner == 'topology-tool-kit' || !contains(github.ref, 'heads') }}
282- env :
283- CCACHE_DIR : /Users/runner/work/ttk/.ccache
284- CCACHE_MAXSIZE : 200M
262+
285263 steps :
286264 - uses : actions/checkout@v4
287265 name : Checkout TTK source code
@@ -297,32 +275,23 @@ jobs:
297275 brew install --cask xquartz
298276 brew install llvm ninja open-mpi
299277 # TTK dependencies
300- brew install boost eigen graphviz numpy qhull ccache
301- # prepend ccache to system path
302- echo "$(brew --prefix)/opt/ccache/libexec" >> $GITHUB_PATH
278+ brew install boost eigen graphviz numpy qhull
279+
280+ - name : Install and setup sccache
281+ uses : f3d-app/sccache-setup-action@v1
282+ with :
283+ key : macos-0
303284
304285 - name : Install optional dependencies
305286 uses : ./.github/actions/install-deps-unix
306287
307- - name : Fetch archived ccache
308- continue-on-error : true
309- run : |
310- wget https://github.com/topology-tool-kit/ttk/releases/download/ccache/ttk-ccache-macOS.tar.gz
311-
312- - name : Decompress ccache archive
313- continue-on-error : true
314- run : |
315- tar xzf ttk-ccache-macOS.tar.gz
316- rm -rf /Users/runner/work/ttk/.ccache
317- mv .ccache /Users/runner/work/ttk/
318-
319288 - name : Fetch TTK-ParaView headless macOS binary archive
320289 run : |
321- wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless.tar.gz
290+ wget https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless-macos-12 .tar.gz
322291
323292 - name : Install ParaView
324293 run : |
325- tar xzf ttk-paraview-headless.tar.gz
294+ tar xzf ttk-paraview-headless-macos-12 .tar.gz
326295 sudo cp -r ttk-paraview/* /usr/local
327296 pvpython -m pip install --break-system-packages scikit-learn
328297
@@ -337,8 +306,8 @@ jobs:
337306 cd build
338307 cmake \
339308 -DCMAKE_BUILD_TYPE=Release \
340- -DCMAKE_C_COMPILER_LAUNCHER=ccache \
341- -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
309+ -DCMAKE_C_COMPILER_LAUNCHER=sccache \
310+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache \
342311 -DTTK_BUILD_PARAVIEW_PLUGINS=TRUE \
343312 -DTTK_BUILD_VTK_WRAPPERS=TRUE \
344313 -DTTK_BUILD_STANDALONE_APPS=TRUE \
@@ -359,6 +328,10 @@ jobs:
359328 cmake --build . --parallel
360329 sudo cmake --build . --target install
361330
331+ - name : Show sccache results
332+ shell : bash
333+ run : sccache --show-stats
334+
362335 - name : Set PYTHONPATH for macOS pvpython
363336 run : |
364337 # pvpython does not embed the correct PYTHONPATH
@@ -407,22 +380,6 @@ jobs:
407380 cat python/res.json
408381 diff python/hashes/macOS.json python/res.json
409382
410- - name : Archive cache
411- run : |
412- ccache -s
413- ccache -c
414- cd /Users/runner/work/ttk
415- tar czf ttk-ccache.tar.gz .ccache
416-
417- - name : Upload ccache archive
418- if : ${{ github.repository_owner == 'topology-tool-kit' && contains(github.ref, 'heads') }}
419- uses : actions/upload-artifact@v4
420- with :
421- name : ttk-ccache-macOS
422- path : /Users/runner/work/ttk/ttk-ccache.tar.gz
423- retention-days : 2
424-
425-
426383 # ------------------ #
427384 # Test Windows build #
428385 # ------------------ #
@@ -433,7 +390,6 @@ jobs:
433390 PV_DIR : C:\Program Files\TTK-ParaView
434391 TTK_DIR : C:\Program Files (x86)\ttk
435392 CONDA_ROOT : C:\Miniconda
436- SCCACHE_CACHE_SIZE : 200M
437393 steps :
438394 - uses : actions/checkout@v4
439395 name : Checkout TTK source code
@@ -444,32 +400,22 @@ jobs:
444400 shell : bash
445401 run : |
446402 conda install -c conda-forge libboost-devel glew eigen spectralib zfp \
447- scikit-learn graphviz ninja sccache=0.4.2 python=3.10 zlib qhull llvm-openmp clangxx
448- # add sccache to PATH
449- echo "$CONDA_ROOT/bin" >> $GITHUB_PATH
403+ scikit-learn graphviz ninja python=3.10 zlib qhull llvm-openmp clangxx
450404 # add TTK & ParaView install folders to PATH
451405 echo "$PV_DIR/bin" >> $GITHUB_PATH
452406 echo "$TTK_DIR/bin" >> $GITHUB_PATH
453407 conda info --all
454408
409+ - name : Install and setup sccache
410+ uses : f3d-app/sccache-setup-action@v1
411+ with :
412+ key : windows-0
413+
455414 - name : Remove hosted Python
456415 shell : bash
457416 run : |
458417 rm -rf C:/hostedtoolcache/windows/Python
459418
460- - name : Fetch archived ccache
461- continue-on-error : true
462- run : |
463- curl.exe -OL https://github.com/topology-tool-kit/ttk/releases/download/ccache/ttk-sccache-windows.tar.gz
464-
465- - name : Decompress ccache archive
466- continue-on-error : true
467- shell : bash
468- run : |
469- tar xzf ttk-sccache-windows.tar.gz
470- mkdir -p /c/Users/runneradmin/AppData/Local/Mozilla/sccache
471- mv cache /c/Users/runneradmin/AppData/Local/Mozilla/sccache
472-
473419 - name : Fetch TTK-ParaView headless Windows installer
474420 run : |
475421 curl.exe -OL https://github.com/${{ env.PV_REPO }}/releases/download/${{ env.PV_TAG }}/ttk-paraview-headless.exe
@@ -486,8 +432,6 @@ jobs:
486432 set CC=clang-cl.exe
487433 set CXX=clang-cl.exe
488434 call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
489- sccache --stop-server
490- sccache --start-server
491435 mkdir build
492436 cd build
493437 cmake ^
@@ -530,6 +474,10 @@ jobs:
530474 call "%ProgramFiles%\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
531475 cmake --build . --config Release --parallel --target install
532476
477+ - name : Show sccache results
478+ shell : bash
479+ run : sccache --show-stats
480+
533481 - name : Test C++ example
534482 shell : cmd
535483 run : |
@@ -610,99 +558,3 @@ jobs:
610558 cd ttk-data
611559 type python\res.json
612560 FC python\hashes\windows.json python\res.json
613-
614- - name : Archive cache
615- shell : bash
616- run : |
617- sccache -s
618- cd /c/Users/runneradmin/AppData/Local/Mozilla/sccache
619- tar czf ttk-sccache.tar.gz cache
620-
621- - name : Upload sccache archive
622- if : ${{ github.repository_owner == 'topology-tool-kit' && contains(github.ref, 'heads') }}
623- uses : actions/upload-artifact@v4
624- with :
625- name : ttk-sccache-windows
626- path : C:\Users\runneradmin\AppData\Local\Mozilla\sccache\ttk-sccache.tar.gz
627- retention-days : 2
628-
629-
630- # ---------------------------------------- #
631- # Upload ccache archives as release assets #
632- # ---------------------------------------- #
633- ccache-release :
634- runs-on : ubuntu-latest
635- needs : [test-build-ubuntu, test-build-macos, test-build-windows]
636- # trigger job only on the "topology-tool-kit" repository in case
637- # of a branch push (pull requests and tags not affected)
638- if : ${{ github.repository_owner == 'topology-tool-kit' && contains(github.ref, 'heads') }}
639- steps :
640-
641- - name : Delete previous release
642- uses : actions/github-script@v6
643- continue-on-error : true
644- with :
645- script : |
646- const { owner, repo } = context.repo
647- const { data: { id } } = await github.rest.repos.getReleaseByTag({
648- owner,
649- repo,
650- tag: "ccache"
651- })
652- await github.rest.repos.deleteRelease({ owner, repo, release_id: id })
653-
654- - name : Create Release
655- uses : actions/github-script@v6
656- with :
657- script : |
658- const { owner, repo } = context.repo
659- await github.rest.repos.createRelease({
660- owner,
661- repo,
662- tag_name: "ccache",
663- name: "ccache archives",
664- body: "Holds ccache archives to speed up build jobs",
665- draft: false,
666- prerelease: true
667- })
668-
669- - name : Fetch all uploaded artifacts
670- uses : actions/download-artifact@v4.1.7
671-
672- - name : Upload Ubuntu Focal .deb as Release Asset
673- uses : svenstaro/upload-release-action@v2
674- with :
675- repo_token : ${{ secrets.GITHUB_TOKEN }}
676- tag : ccache
677- file : ttk-ccache-ubuntu-20.04/ttk-ccache.tar.gz
678- asset_name : ttk-ccache-ubuntu-20.04.tar.gz
679-
680- - name : Upload Ubuntu Jammy .deb as Release Asset
681- uses : svenstaro/upload-release-action@v2
682- with :
683- repo_token : ${{ secrets.GITHUB_TOKEN }}
684- tag : ccache
685- file : ttk-ccache-ubuntu-22.04/ttk-ccache.tar.gz
686- asset_name : ttk-ccache-ubuntu-22.04.tar.gz
687-
688- - name : Upload .pkg as Release Asset
689- uses : svenstaro/upload-release-action@v2
690- with :
691- repo_token : ${{ secrets.GITHUB_TOKEN }}
692- tag : ccache
693- file : ttk-ccache-macOS/ttk-ccache.tar.gz
694- asset_name : ttk-ccache-macOS.tar.gz
695-
696- - name : Upload sccache Windows archive
697- uses : svenstaro/upload-release-action@v2
698- with :
699- repo_token : ${{ secrets.GITHUB_TOKEN }}
700- tag : ccache
701- file : ttk-sccache-windows/ttk-sccache.tar.gz
702- asset_name : ttk-sccache-windows.tar.gz
703-
704- - name : Delete ccache artifacts
705- uses : geekyeggo/delete-artifact@v2
706- with :
707- name : |
708- ttk-*ccache*
0 commit comments