@@ -10,126 +10,36 @@ on: [push, pull_request, workflow_dispatch]
10
10
11
11
jobs :
12
12
job :
13
- name : ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.linkage }}-${{ matrix. config }}
13
+ name : ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.config }}
14
14
runs-on : ${{ matrix.os }}
15
15
strategy :
16
16
fail-fast : false
17
17
matrix :
18
18
os : [ubuntu-latest, macos-latest, windows-latest]
19
- config : [dbg, rel]
20
- linkage : [static, shared]
19
+ config : [Debug, Release]
21
20
include :
22
- # - os: windows-latest
23
- # triplet: x64-windows
24
21
# - os: ubuntu-latest
25
- # triplet: x64-linux
26
- # - os: ubuntu-latest
27
- # triplet: i686-linux
28
- # - os: macos-latest
29
- # triplet: x64-osx
30
- - os : windows-latest
31
- config : dbg
32
- linkage : shared
33
- add_shared_path : $env:PATH += ";" + (Get-Item .).FullName + "\builds\ninja-cl-shared\src\Debug"
34
- - os : windows-latest
35
- config : rel
36
- add_shared_path : $env:PATH += ";" + (Get-Item .).FullName + "\builds\ninja-cl-shared\src\Release"
37
- - os : ubuntu-latest
38
- gcc12 : true
39
- compiler : g++-12
22
+ # compiler: g++-12
40
23
- os : ubuntu-latest
41
- clang18 : true
42
24
compiler : clang++-18
43
25
pre_configure : dev/ci-pre-configure-clang 18
44
26
- os : macos-latest
45
27
compiler : c++
46
28
- os : windows-latest
47
29
compiler : cl
48
- env :
49
- # Indicates the location of the vcpkg as a Git submodule of the project
50
- # repository. Not using "VCPKG_ROOT" because a variable with the same name
51
- # is defined in the VS's Developer Command Prompt environment in VS 2022
52
- # 17.6, which would override this one if it had the same name.
53
- # ^^^ JLL: macos needs VCPKG_ROOT.
54
- VCPKG_ROOT : ${{ github.workspace }}/vcpkg
55
- _VCPKG_ : ${{ github.workspace }}/vcpkg
56
- # Tells vcpkg where binary packages are stored.
57
- VCPKG_DEFAULT_BINARY_CACHE : ${{ github.workspace }}/vcpkg/bincache
58
- # Let's use GitHub Action cache as storage for the vcpkg Binary Caching feature.
59
- VCPKG_BINARY_SOURCES : ' clear;x-gha,readwrite'
60
- CXX : ${{ matrix.compiler }}
61
-
62
30
steps :
63
31
# - name: List compilers
64
32
# run: |
65
33
# apt list --installed | grep clang
66
34
# apt list --installed | grep g++
67
35
68
- # Set env vars needed for vcpkg to leverage the GitHub Action cache as a storage
69
- # for Binary Caching.
70
- - uses : actions/github-script@v7
71
- with :
72
- script : |
73
- core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
74
- core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
75
-
76
36
- uses : actions/checkout@v4
77
- with :
78
- submodules : true
79
- - name : " Create directory '${{ env.VCPKG_DEFAULT_BINARY_CACHE }}'"
80
- run : mkdir -p $VCPKG_DEFAULT_BINARY_CACHE
81
- shell : bash
82
-
83
- # Setup the build machine with the most recent versions of CMake and
84
- # Ninja. Both are cached if not already: on subsequent runs both will be
85
- # quickly restored from GitHub cache service.
86
- - uses : lukka/get-cmake@latest
87
-
88
- # Restore vcpkg from the GitHub Action cache service. Note that packages
89
- # are restored by vcpkg's binary caching when it is being run afterwards
90
- # by CMake.
91
- - name : Restore vcpkg
92
- uses : actions/cache@v4
93
- with :
94
- # The first path is the location of vcpkg: it contains the vcpkg
95
- # executable and data files, as long as the built package archives
96
- # (aka binary cache) which are located by VCPKG_DEFAULT_BINARY_CACHE
97
- # env var. The other paths starting with '!' are exclusions: they
98
- # contain termporary files generated during the build of the installed
99
- # packages.
100
- path : |
101
- ${{ env._VCPKG_ }}
102
- !${{ env._VCPKG_ }}/buildtrees
103
- !${{ env._VCPKG_ }}/packages
104
- !${{ env._VCPKG_ }}/downloads
105
- !${{ env._VCPKG_ }}/installed
106
- # The key is composed in a way that it gets properly invalidated whenever a different version of vcpkg is being used.
107
- key : |
108
- ${{ hashFiles( '.git/modules/vcpkg/HEAD' )}}
109
-
110
- # On Windows runners, let's ensure to have the Developer Command Prompt
111
- # environment setup correctly. As used here the Developer Command Prompt
112
- # created is targeting x64 and using the default the Windows SDK.
113
- - uses : ilammy/msvc-dev-cmd@v1
114
-
115
- # Run CMake to generate Ninja project files, using the vcpkg's toolchain
116
- # file to resolve and install the dependencies as specified in vcpkg.json.
117
- # Note that the vcpkg's toolchain is specified in the CMakePresets.json
118
- # file.
119
-
120
- # This step also runs vcpkg with Binary Caching leveraging GitHub Action
121
- # cache to store the built packages artifacts.
122
- - name : Restore from cache the dependencies and generate project files
37
+ - name : Configure
123
38
run : |
124
- ${{ matrix.pre_configure }}
125
- cmake --preset ninja-${{ matrix.compiler }}-${{ matrix.linkage }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
126
-
39
+ cmake -S . -B __build__ -DCMAKE_CXX_COMPILER=${{ matrix.compiler }} -DCMAKE_BUILD_TYPE=${{ matrix.config }}
127
40
- name : Build
128
41
run : |
129
- ${{ matrix.add_shared_path }}
130
- cmake --build --preset build-ninja-${{ matrix.compiler }}-${{ matrix.linkage}}-${{ matrix.config }}
131
-
42
+ cmake --build __build__
132
43
- name : Test
133
44
run : |
134
- ${{ matrix.add_shared_path }}
135
- ctest --preset test-ninja-${{ matrix.compiler }}-${{ matrix.linkage}}-${{ matrix.config }} --output-on-failure
45
+ cmake --build __build__ --config ${{ matrix.config }} --target all -j 16 --
0 commit comments