Skip to content

Commit 7643c70

Browse files
committed
Update cmake.yml
1 parent 975005c commit 7643c70

File tree

1 file changed

+12
-26
lines changed

1 file changed

+12
-26
lines changed

.github/workflows/cmake.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# This workflow is for a CMake project running on multiple platforms.
2-
# See: https://github.com/actions/starter-workflows/blob/main/ci/cmake-multi-platform.yml
1+
# This workflow is for a CMake project running on Debian using an Ubuntu host runner.
32
name: CMake Build and Test
43

54
on:
@@ -18,20 +17,14 @@ on:
1817

1918
jobs:
2019
cmake_build:
21-
runs-on: debian-11
20+
runs-on: ubuntu-latest
21+
container:
22+
image: debian:stable-slim # Debian environment for the build
2223

2324
strategy:
24-
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable.
2525
fail-fast: false
26-
27-
# Set up a matrix to run the following 3 configurations:
28-
# 1. <Windows, Release, latest MSVC compiler toolchain on the default runner image, default generator>
29-
# 2. <Linux, Release, latest GCC compiler toolchain on the default runner image, default generator>
30-
# 3. <Linux, Release, latest Clang compiler toolchain on the default runner image, default generator>
31-
#
32-
# To add more build types (Release, Debug, RelWithDebInfo, etc.) customize the build_type list.
3326
matrix:
34-
os: [debian-11]
27+
os: [debian-stable]
3528
build_type: ${{ fromJSON(format('[{0}]', inputs.build_type || '"Debug","Release"')) }}
3629
c_compiler: [clang]
3730
cpp_compiler: [clang++]
@@ -42,29 +35,26 @@ jobs:
4235
submodules: true
4336

4437
- name: Set reusable strings
45-
# Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file.
4638
id: strings
4739
shell: bash
4840
run: |
4941
echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
5042
51-
- name: Install Clang and Libraries
43+
- name: Install Clang, CMake, and Libraries
5244
run: |
53-
sudo apt-get update
54-
sudo apt-get install -y clang libc++-dev libc++abi-dev
45+
apt-get update
46+
apt-get install -y clang libc++-dev libc++abi-dev cmake make git lld
5547
5648
- name: Check Clang Settings
5749
run: |
5850
clang --version
5951
clang++ --version
6052
echo "Checking clang headers..."
6153
clang++ -v -E -x c++ /dev/null
62-
echo "check lld..."
54+
echo "Check ldd..."
6355
ldd --version
6456
6557
- name: Configure CMake
66-
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
67-
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
6858
run: >
6959
cmake -B ${{ steps.strings.outputs.build-output-dir }}
7060
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
@@ -73,26 +63,22 @@ jobs:
7363
-S ${{ github.workspace }}
7464
7565
- name: Build
76-
# Build your program with the given configuration. Note that --config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
7766
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} --verbose
7867

7968
- name: Test
8069
working-directory: ${{ steps.strings.outputs.build-output-dir }}
81-
# Execute tests defined by the CMake configuration. Note that --build-config is needed because the default Windows generator is a multi-config generator (Visual Studio generator).
82-
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
8370
run: ctest --build-config ${{ matrix.build_type }} --verbose --output-on-failure
8471

8572
- name: Package Build Artifacts
8673
run: |
8774
mkdir -p ${{ steps.strings.outputs.build-output-dir }}/package
88-
# Adjust the path to your built library files
89-
cp ${{ steps.strings.outputs.build-output-dir }}/${{ matrix.build_type }}/*GameAnalytics.* ${{ steps.strings.outputs.build-output-dir }}/package/
75+
cp ${{ steps.strings.outputs.build-output-dir }}/${{ matrix.build_type }}/*GameAnalytics.* ${{ steps.strings.outputs.build-output-dir }}/package/ || true
9076
cp -r ${{ github.workspace }}/include ${{ steps.strings.outputs.build-output-dir }}/package/
9177
9278
- name: Upload Build Artifact
79+
if: ${{ inputs.upload_artifacts }}
9380
uses: actions/upload-artifact@v4
9481
with:
9582
name: ga-cpp-sdk-${{ matrix.os }}-${{ matrix.c_compiler }}-${{ matrix.build_type }}
9683
path: ${{ steps.strings.outputs.build-output-dir }}/package/
97-
retention-days: 3
98-
84+
retention-days: 3

0 commit comments

Comments
 (0)