Refactor env variables

This commit is contained in:
Gudmundur Adalsteinsson 2021-07-14 10:33:50 +00:00
parent 8eb3515f8b
commit 3696f50b39

View File

@ -88,8 +88,6 @@ jobs:
CXX: ${{ matrix.cxx }} CXX: ${{ matrix.cxx }}
VERBOSE: 1 VERBOSE: 1
THREADS: 2 THREADS: 2
LIBZMQ: ${{ env.GITHUB_WORKSPACE }}/libzmq-build
CPPZMQ: ${{ env.GITHUB_WORKSPACE }}/cppzmq-build
BUILDTYPE: "Debug" BUILDTYPE: "Debug"
COVERAGE: "OFF" # TODO COVERAGE: "OFF" # TODO
@ -109,42 +107,56 @@ jobs:
- name: build_libzmq_cmake - name: build_libzmq_cmake
if: ${{ matrix.libzmqbuild == 'cmake' }} if: ${{ matrix.libzmqbuild == 'cmake' }}
run: | run: |
cmake -Hlibzmq-${{ matrix.libzmq }} -B${LIBZMQ} ${{ matrix.platform}} \ cmake -Hlibzmq-${{ matrix.libzmq }} -Blibzmq-build ${{ matrix.platform}} \
-DWITH_PERF_TOOL=OFF \ -DWITH_PERF_TOOL=OFF \
-DZMQ_BUILD_TESTS=OFF \ -DZMQ_BUILD_TESTS=OFF \
-DCMAKE_BUILD_TYPE=Release \ -DCMAKE_BUILD_TYPE=Release \
-DENABLE_DRAFTS=${{ matrix.drafts }} -DENABLE_DRAFTS=${{ matrix.drafts }}
cmake --build ${LIBZMQ} -- ${{ matrix.makeargs }} cmake --build libzmq-build -- ${{ matrix.makeargs }}
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build_libzmq_pkgconfig - name: build_libzmq_pkgconfig
if: ${{ matrix.libzmqbuild == 'pkgconfig' }} if: ${{ matrix.libzmqbuild == 'pkgconfig' }}
working-directory: libzmq-${{ matrix.libzmq }} working-directory: libzmq-${{ matrix.libzmq }}
run: | run: |
./autogen.sh && ./autogen.sh &&
./configure --prefix=${LIBZMQ} && ./configure --prefix=${PWD}/libzmq-build &&
make ${{ matrix.makeargs }} make ${{ matrix.makeargs }}
make install make install
echo "LIBZMQ=${PWD}/libzmq-build" >> ${GITHUB_ENV}
- name: build - name: build
env: env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }} CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}
run: | run: |
cmake -H. -B${CPPZMQ} ${{ matrix.platform}} \ cmake -H. -Bbuild ${{ matrix.platform}} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \ -DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DENABLE_DRAFTS=${{ matrix.drafts }} \ -DENABLE_DRAFTS=${{ matrix.drafts }} \
-DCOVERAGE=${COVERAGE} \ -DCOVERAGE=${COVERAGE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }} -DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build ${CPPZMQ} -- ${{ matrix.makeargs }} cmake --build build -- ${{ matrix.makeargs }}
echo "CPPZMQ=${PWD}/build" >> ${GITHUB_ENV}
- name: test - name: test
working-directory: ${{ env.CPPZMQ }} run: |
run: ctest -V -C ${BUILDTYPE} cd ${{ env.CPPZMQ }}
echo ${{ env.CPPZMQ }}
ctest -V -C ${BUILDTYPE}
- name: demo - name: demo
env: env:
CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}:${{ env.CPPZMQ }} CMAKE_PREFIX_PATH: ${{ env.LIBZMQ }}:${{ env.CPPZMQ }}
run: | run: |
cmake -Hdemo -Bdemo/build if [[ ${{ matrix.os }} == windows* ]]; then
cmake --build demo/build DELIM=";"
cd demo/build else
DELIM=":"
fi
export CMAKE_PREFIX_PATH=${{ env.LIBZMQ }}${DELIM}${{ env.CPPZMQ }}
cd demo
cmake -H. -Bbuild ${{ matrix.platform}} \
-DCMAKE_BUILD_TYPE=${BUILDTYPE} \
-DCMAKE_CXX_STANDARD=${{ matrix.cppstd }}
cmake --build build -- ${{ matrix.makeargs }}
cd build
ctest -V -C ${BUILDTYPE} ctest -V -C ${BUILDTYPE}