ci: Consequtive jobs in GitHub Actions does not work like a pipeline -> make one huge job

This commit is contained in:
Mateusz Pusz
2020-12-17 23:44:53 +01:00
parent 9bcc8464cc
commit cd5ff553cd

View File

@@ -40,9 +40,13 @@ env:
CMAKE_GENERATOR: Ninja CMAKE_GENERATOR: Ninja
jobs: jobs:
setup: test_package:
name: Environment setup
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
build_type: [ "Release", "Debug" ]
name: mp-units installation (${{ matrix.build_type }})
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Cache Conan data - name: Cache Conan data
@@ -70,47 +74,27 @@ jobs:
run: | run: |
conan config init conan config init
conan remote add upload ${{ secrets.CONAN_UPLOAD }} conan remote add upload ${{ secrets.CONAN_UPLOAD }}
install:
needs: setup
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
build_type: [ "Release", "Debug" ]
name: mp-units installation (${{ matrix.build_type }})
steps:
- name: Install Conan dependencies - name: Install Conan dependencies
run: | run: |
mkdir -p build/${{ matrix.build_type }} && cd build/${{ matrix.build_type }} mkdir -p build/${{ matrix.build_type }} && cd build/${{ matrix.build_type }}
conan install ../.. -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -s build_type=${{ matrix.build_type }} -b outdated -u conan install ../.. -s compiler.cppstd=20 -s compiler.libcxx=libstdc++11 -s build_type=${{ matrix.build_type }} -b outdated -u
- name: Configure CMake - name: Configure mp-units CMake
run: | run: |
cd build/${{ matrix.build_type }} cd build/${{ matrix.build_type }}
cmake ../../src -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake cmake ../../src -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake
- name: Install - name: Install mp-units
run: | run: |
cd build/${{ matrix.build_type }} cd build/${{ matrix.build_type }}
cmake --install . --prefix test_package cmake --install . --prefix test_package
- name: Configure test_package CMake
test_package:
needs: install
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
build_type: [ "Release", "Debug" ]
name: Testing CMake package (${{ matrix.build_type }})
steps:
- name: Configure CMake
run: | run: |
mkdir -p test_package/build/${{ matrix.build_type }} && cd test_package/build/${{ matrix.build_type }} mkdir -p test_package/build/${{ matrix.build_type }} && cd test_package/build/${{ matrix.build_type }}
cmake ../.. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=../../../build/${{ matrix.build_type }}/test_package -DCMAKE_TOOLCHAIN_FILE=../../../build/${{ matrix.build_type }}/conan_paths.cmake cmake ../.. -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DCMAKE_INSTALL_PREFIX=../../../build/${{ matrix.build_type }}/test_package -DCMAKE_TOOLCHAIN_FILE=../../../build/${{ matrix.build_type }}/conan_paths.cmake
- name: Build - name: Build test_package
run: | run: |
cd test_package/build/${{ matrix.build_type }} cd test_package/build/${{ matrix.build_type }}
cmake --build . cmake --build .
- name: Run - name: Run test_package
run: | run: |
cd test_package/build/${{ matrix.build_type }} cd test_package/build/${{ matrix.build_type }}
./test_package ./test_package