1
1
name : CMake Build Matrix
2
2
3
- # Controls when the action will run. Triggers the workflow on push
4
- on :
5
- push :
6
- branches : [ "master" ]
7
- pull_request :
8
- branches : [ "master" ]
3
+ on : [push, pull_request]
9
4
10
5
jobs :
11
6
build :
25
20
environment_script : " C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" ,
26
21
generator : " Visual Studio 17 2022"
27
22
}
28
- - {
29
- name : " Windows Latest MinGW" ,
30
- os : windows-latest,
31
- artifact : " windows_mingw" ,
32
- build_type : " Release" ,
33
- cc : " gcc" ,
34
- cxx : " g++" ,
35
- generator : " Ninja"
36
- }
37
23
- {
38
24
name : " Ubuntu Latest GCC" ,
39
25
os : ubuntu-latest,
@@ -95,28 +81,19 @@ jobs:
95
81
-G "${{ matrix.config.generator }}"
96
82
97
83
- name : Build
98
- working-directory : ${{github.workspace}}/build
84
+ working-directory : ${{ github.workspace }}/build
99
85
shell : bash
100
86
run : cmake --build . --config ${{ matrix.config.build_type }}
101
87
102
88
- name : Log
103
89
run : echo ${{ matrix.config.generator }}
104
90
105
- - name : Execute generated by VS
106
- if : ${{ matrix.config.generator == 'Visual Studio 17 2022' }}
107
- run : ${{ github.workspace }}\build\bin\${{ matrix.config.build_type }}\hw1.exe
108
-
109
- - name : Execute
110
- if : ${{ matrix.config.generator != 'Visual Studio 17 2022' }}
111
- working-directory : ${{ github.workspace }}/build/bin
112
- run : ./hw1
113
-
114
91
- name : Test
115
- working-directory : ${{github.workspace}}/build
92
+ working-directory : ${{ github.workspace }}/build
116
93
run : ctest -C ${{ matrix.config.build_type }}
117
94
118
95
- name : Upload Artifacts
119
96
uses : actions/upload-artifact@v3
120
97
with :
121
- path : ${{github.workspace}}/build/bin/
98
+ path : ${{ github.workspace }}/build/bin/${{ matrix.config.build_type }}
122
99
name : ${{ matrix.config.artifact }}
0 commit comments