@@ -49,16 +49,24 @@ jobs:
4949 shared_library : ${{ fromJSON(inputs.shared_lib)}}
5050 os : ${{ fromJSON(inputs.os)}}
5151 build_type : ${{ fromJSON(inputs.build_type)}}
52- include :
53- - os : ' Ubuntu'
54- compiler : {c: gcc, cxx: g++}
55- number_of_processors : ' $(nproc)'
56- - os : ' Windows'
57- compiler : {c: cl, cxx: cl}
58- number_of_processors : ' $Env:NUMBER_OF_PROCESSORS'
5952
6053 runs-on : ["DSS-${{inputs.runner}}", "DSS-${{matrix.os}}"]
6154 steps :
55+ # Set number of processes and compiler based on OS
56+ - name : " [Win] Establish build params"
57+ if : ${{ matrix.os == 'Windows' }}
58+ run : |
59+ echo "C_COMPILER=cl" >> $GITHUB_ENV
60+ echo "CXX_COMPILER=cl" >> $GITHUB_ENV
61+ echo "PROCS=$Env:NUMBER_OF_PROCESSORS" >> $GITHUB_ENV
62+
63+ - name : " [Lin] Establish build params"
64+ if : ${{ matrix.os == 'Ubuntu' }}
65+ run : |
66+ echo "C_COMPILER=gcc" >> $GITHUB_ENV
67+ echo "CXX_COMPILER=g++" >> $GITHUB_ENV
68+ echo "PROCS=$(nproc)" >> $GITHUB_ENV
69+
6270 - name : Checkout
6371 uses : actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
6472 with :
8997 -B ${{env.BUILD_DIR}}
9098 -DCMAKE_INSTALL_PREFIX="${{env.INSTL_DIR}}"
9199 -DCMAKE_BUILD_TYPE=${{matrix.build_type}}
92- -DCMAKE_C_COMPILER=${{matrix.compiler.c }}
93- -DCMAKE_CXX_COMPILER=${{matrix.compiler.cxx }}
100+ -DCMAKE_C_COMPILER=${{env.C_COMPILER }}
101+ -DCMAKE_CXX_COMPILER=${{env.CXX_COMPILER }}
94102 -DUMF_BUILD_SHARED_LIBRARY=${{matrix.shared_library}}
95103 -DUMF_BUILD_BENCHMARKS=ON
96104 -DUMF_BUILD_BENCHMARKS_MT=ON
@@ -107,7 +115,7 @@ jobs:
107115 ${{ matrix.os == 'Windows' && '-DCMAKE_SUPPRESS_REGENERATION=ON' || '' }}
108116
109117 - name : Build UMF
110- run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{matrix.number_of_processors }}
118+ run : cmake --build ${{env.BUILD_DIR}} --config ${{matrix.build_type}} -j ${{env.PROCS }}
111119
112120 - name : Run tests
113121 working-directory : ${{env.BUILD_DIR}}
0 commit comments