44 push :
55 branches : [ master, develop ]
66 pull_request :
7- branches : [ master, master ]
7+ branches : [ master ]
88
99jobs :
1010 build :
@@ -15,17 +15,20 @@ jobs:
1515 matrix :
1616 os : [ubuntu-latest, macos-latest, windows-latest]
1717 build-type : [Release, Debug]
18- compiler : [gcc, clang]
19- exclude :
20- # Windows не использует gcc/clang напрямую в matrix
21- - os : windows-latest
18+ include :
19+ - os : ubuntu-latest
2220 compiler : gcc
23- - os : windows-latest
21+ cxx_compiler : g++
22+ - os : ubuntu-latest
2423 compiler : clang
25- include :
24+ cxx_compiler : clang++
25+ - os : macos-latest
26+ compiler : clang
27+ cxx_compiler : clang++
2628 - os : windows-latest
2729 compiler : msvc
28- cmake-generator : " Visual Studio 17 2022"
30+ cxx_compiler : cl
31+ generator : " Visual Studio 17 2022"
2932
3033 steps :
3134 - name : Checkout code
@@ -42,33 +45,45 @@ jobs:
4245 run : |
4346 brew install cmake
4447
45- - name : Configure CMake (Unix )
48+ - name : Configure CMake (Linux/macOS )
4649 if : runner.os != 'Windows'
4750 run : |
4851 cmake -B build \
4952 -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} \
50- -DCMAKE_CXX_COMPILER=${{ matrix.compiler }}
53+ -DCMAKE_C_COMPILER=${{ matrix.compiler }} \
54+ -DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }}
5155
5256 - name : Configure CMake (Windows)
5357 if : runner.os == 'Windows'
5458 run : |
55- cmake -B build -G "${{ matrix.cmake- generator }}"
59+ cmake -B build -G "${{ matrix.generator }}"
5660
57- - name : Build
58- run : cmake --build build --config ${{ matrix.build-type }}
61+ - name : Build (Linux/macOS)
62+ if : runner.os != 'Windows'
63+ run : cmake --build build -j$(nproc)
5964
60- - name : Run Tests
65+ - name : Build (Windows)
66+ if : runner.os == 'Windows'
67+ run : cmake --build build --config ${{ matrix.build-type }} -j$env:NUMBER_OF_PROCESSORS
68+
69+ - name : Run Tests (Linux/macOS)
70+ if : runner.os != 'Windows'
6171 run : |
6272 cd build
6373 ./hash_table_demo
64- shell : bash
74+
75+ - name : Run Tests (Windows)
76+ if : runner.os == 'Windows'
77+ run : |
78+ cd build
79+ .\${{ matrix.build-type }}\hash_table_demo.exe
6580
6681 - name : Upload Artifact
6782 uses : actions/upload-artifact@v4
6883 if : matrix.build-type == 'Release'
6984 with :
7085 name : hash_table_demo-${{ runner.os }}-${{ matrix.build-type }}
71- path : build/hash_table_demo
86+ path : ${{ runner.os == 'Windows' && ' build/Release/ hash_table_demo.exe' || 'build/hash_table_demo' }}
7287 retention-days : 7
7388
7489 code-quality :
0 commit comments