Skip to content

Commit faf4ea0

Browse files
committed
CI
1 parent bbac0ba commit faf4ea0

File tree

1 file changed

+7
-97
lines changed

1 file changed

+7
-97
lines changed

.github/workflows/main.yml

Lines changed: 7 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -10,126 +10,36 @@ on: [push, pull_request, workflow_dispatch]
1010

1111
jobs:
1212
job:
13-
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.linkage }}-${{ matrix.config }}
13+
name: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.config }}
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
1717
matrix:
1818
os: [ubuntu-latest, macos-latest, windows-latest]
19-
config: [dbg, rel]
20-
linkage: [static, shared]
19+
config: [Debug, Release]
2120
include:
22-
# - os: windows-latest
23-
# triplet: x64-windows
2421
# - 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
4023
- os: ubuntu-latest
41-
clang18: true
4224
compiler: clang++-18
4325
pre_configure: dev/ci-pre-configure-clang 18
4426
- os: macos-latest
4527
compiler: c++
4628
- os: windows-latest
4729
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-
6230
steps:
6331
# - name: List compilers
6432
# run: |
6533
# apt list --installed | grep clang
6634
# apt list --installed | grep g++
6735

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-
7636
- 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
12338
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 }}
12740
- name: Build
12841
run: |
129-
${{ matrix.add_shared_path }}
130-
cmake --build --preset build-ninja-${{ matrix.compiler }}-${{ matrix.linkage}}-${{ matrix.config }}
131-
42+
cmake --build __build__
13243
- name: Test
13344
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

Comments
 (0)