File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99jobs :
1010 build :
1111 runs-on : ubuntu-latest
12+ strategy :
13+ matrix :
14+ compiler : [g++, clang++]
15+ build_type : [Debug, Release]
16+ env :
17+ BUILD_DIR : build
18+ CMAKE_FLAGS : -GNinja -DENABLE_TESTING=ON -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
1219
1320 steps :
1421 - name : Checkout code
15- uses : actions/checkout@v4
22+ uses : actions/checkout@v4.0.0
1623
1724 - name : Install dependencies
18- run : sudo apt-get update && sudo apt-get install -y cmake ninja-build g++ libgtest-dev
25+ run : sudo apt-get update && sudo apt-get install -y cmake ninja-build ${{ matrix.compiler }} libgtest-dev
26+
27+ - name : Cache build
28+ uses : actions/cache@v3
29+ with :
30+ path : ${{ env.BUILD_DIR }}
31+ key : ${{ runner.os }}-build-${{ matrix.compiler }}-${{ hashFiles('**/CMakeLists.txt') }}
32+ restore-keys : |
33+ ${{ runner.os }}-build-${{ matrix.compiler }}-
1934
2035 - name : Configure CMake
21- run : cmake -S . -B build -GNinja -DENABLE_TESTING=ON
36+ run : cmake -S . -B ${{ env.BUILD_DIR }} ${{ env.CMAKE_FLAGS }}
2237
2338 - name : Build
24- run : cmake --build build
39+ run : cmake --build ${{ env.BUILD_DIR }}
2540
2641 - name : Run tests
27- run : ctest --test-dir build --output-on-failure
42+ run : ctest --test-dir ${{ env.BUILD_DIR }} --output-on-failure
43+
44+ - name : Upload Build Artifacts
45+ uses : actions/upload-artifact@v4
46+ with :
47+ name : build-artifacts-${{ matrix.compiler }}-${{ matrix.build_type }}
48+ path : ${{ env.BUILD_DIR }}
You can’t perform that action at this time.
0 commit comments