Merge pull request #441 Cleanup of the Github "build" workflow from SRombauts/github-actions-improvements

This commit is contained in:
Sébastien Rombauts 2023-08-18 15:48:01 +02:00
commit 7a1649ce77

View File

@ -32,7 +32,7 @@ jobs:
generator: "Unix Makefiles", generator: "Unix Makefiles",
build_type: "Debug", build_type: "Debug",
cc: "gcc", cxx: "g++", cc: "gcc", cxx: "g++",
extra_path: "" extra_path: "",
} }
- { - {
name: "macOS Latest Clang", name: "macOS Latest Clang",
@ -40,29 +40,23 @@ jobs:
generator: "Unix Makefiles", generator: "Unix Makefiles",
build_type: "Debug", build_type: "Debug",
cc: "clang", cxx: "clang++", cc: "clang", cxx: "clang++",
extra_path: "" extra_path: "",
} }
steps: steps:
- uses: actions/checkout@v3 - name: Checkout ${{ github.ref_name }}
- name: submodule uses: actions/checkout@v3
run: git submodule update --init --recursive - run: git submodule update --init --recursive
- name: extra_path - name: set extra GITHUB_PATH ${{ matrix.config.extra_path }} (for MinGW)
shell: bash shell: bash
run: echo "${{matrix.config.extra_path}}" >> $GITHUB_PATH run: echo "${{ matrix.config.extra_path }}" >> $GITHUB_PATH
- name: configure - name: set env CXX=${{ matrix.config.cxx }}
shell: cmake -P {0} shell: cmake -P {0}
run: | run: |
set(ENV{CC} ${{matrix.config.cc}}) set(ENV{CC} ${{ matrix.config.cc }})
set(ENV{CXX} ${{matrix.config.cxx}}) set(ENV{CXX} ${{ matrix.config.cxx }})
- name: generate - run: mkdir build
run: | - run: cmake -G "${{ matrix.config.generator }}" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=${{ matrix.config.build_type }} -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_CPPCHECK=OFF -DSQLITECPP_RUN_CPPLINT=OFF ..
mkdir build working-directory: build
cd build - run: cmake --build build --config ${{ matrix.config.build_type }}
cmake -G "${{matrix.config.generator}}" -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_BUILD_TYPE=${{matrix.config.build_type}} -DSQLITECPP_BUILD_EXAMPLES=ON -DSQLITECPP_BUILD_TESTS=ON -DSQLITECPP_RUN_CPPCHECK=OFF -DSQLITECPP_RUN_CPPLINT=OFF .. - run: ctest --verbose --output-on-failure --test-dir build
- name: build
run: cmake --build build --config ${{matrix.config.build_type}}
- name: test
run: |
cd build
ctest --verbose --output-on-failure