1+ on :
2+ push :
3+ branches :
4+ - " main"
5+ pull_request :
6+ workflow_dispatch :
7+
8+ permissions :
9+ contents : write
10+
11+ env :
12+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
13+ _VCPKG_ : ${{ github.workspace }}/external/microsoft/vcpkg
14+ VCPKG_ROOT : ${{ github.workspace }}/external/microsoft/vcpkg
15+ VCPKG_BINARY_SOURCES : " clear;x-gha,readwrite"
16+ VCPKG_DEFAULT_BINARY_CACHE : ${{ github.workspace }}/external/microsoft/vcpkg/bincache
17+ VCPKG_FEATURE_FLAGS : " dependencygraph"
18+
19+ jobs :
20+ build-test :
21+ runs-on : ubuntu-22.04
22+ env :
23+ TRIPLET : x64-linux
24+ steps :
25+ - name : Check out repository code
26+ uses : actions/checkout@v4
27+ with :
28+ submodules : " true"
29+
30+ - uses : actions/github-script@v6
31+ with :
32+ script : |
33+ core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
34+ core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
35+
36+ - name : " Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
37+ run : mkdir -p ${{ github.workspace }}/external/microsoft/vcpkg/bincache
38+ shell : bash
39+
40+ - uses : lukka/get-cmake@latest
41+ with :
42+ cmakeVersion : " 3.29.0"
43+
44+ - name : Restore vcpkg
45+ uses : actions/cache@v3
46+ with :
47+ path : |
48+ ${{ env._VCPKG_ }}
49+ !${{ env._VCPKG_ }}/buildtrees
50+ !${{ env._VCPKG_ }}/packages
51+ !${{ env._VCPKG_ }}/downloads
52+ !${{ env._VCPKG_ }}/installed
53+ key : |
54+ ${{ env.TRIPLET }}-${{ hashFiles( '.git/modules/external/microsoft/vcpkg/HEAD' )}}
55+
56+ - name : Configure
57+ env :
58+ CMAKE_VERBOSE_MAKEFILE : 1
59+ VCPKG_DEBUG : 1
60+ run : |
61+ echo "Configuring for triplet ${{ env.TRIPLET }}"
62+ TRIPLET=${{ env.TRIPLET }} make configure
63+
64+ - name : Upload vcpkg buildtrees
65+ if : always()
66+ uses : actions/upload-artifact@v4
67+ with :
68+ name : vcpkg-buildtrees-${{ env.TRIPLET }}-${{ github.sha }}
69+ path : external/microsoft/vcpkg/buildtrees/science-scipp
70+ retention-days : 1
71+
72+ - name : Build
73+ run : NPROC=1 make build
74+
75+ - uses : actions/upload-artifact@v4
76+ with :
77+ name : build-${{ env.TRIPLET }}-${{ github.sha }}
78+ path : build
79+ retention-days : 1
80+
81+ - name : Run tests
82+ run : make test
83+ shell : bash
0 commit comments