macOS #229
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: macOS | |
| on: | |
| workflow_call: | |
| push: | |
| branches: [ main ] | |
| schedule: | |
| - cron: "4 5 * * 0" | |
| jobs: | |
| build: | |
| if: ${{!contains(github.event.head_commit.message, 'skip-ci')}} | |
| strategy: | |
| matrix: | |
| build_type: [ Release, Debug ] | |
| os: [macos-14] | |
| # gcc for ARM is not fully supported now | |
| compiler: | |
| - cc: cc | |
| cxx: c++ | |
| # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. | |
| # You can convert this to a matrix build if you need cross-platform coverage. | |
| # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix | |
| runs-on: ${{ matrix.os }} | |
| env: | |
| CC: ${{ matrix.compiler.cc }} | |
| CXX: ${{ matrix.compiler.cxx }} | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Install conan | |
| run: brew install conan | |
| - name: Configure CMake | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} | |
| - name: Build | |
| run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} | |
| - name: Install | |
| run: cmake --install ${{github.workspace}}/build --config ${{ matrix.build_type }} | |
| - name: Configure CMake With Tests | |
| run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TEST=ON | |
| - name: Build Tests | |
| run: cmake --build ${{github.workspace}}/build --config ${{ matrix.build_type }} | |
| - name: Test | |
| run: ctest --output-on-failure --verbose | |
| working-directory: build | |
| - name: Run cppship | |
| run: | | |
| rm -rf build | |
| type cppship | |
| cppship | |
| cppship build --profile ${{ matrix.build_type }} | |
| cppship run --profile ${{ matrix.build_type }} | |
| cppship test --profile ${{ matrix.build_type }} | |
| cppship clean | |
| - name: Cppship init app | |
| run: | | |
| mkdir .bin && cd .bin | |
| cppship init . --name app | |
| cppship build | |
| cppship run | |
| cppship test | |
| cppship install | |
| type app | |
| cd .. | |
| - name: Cppship init lib | |
| run: | | |
| mkdir .lib && cd .lib | |
| cppship init . --name lib --lib | |
| cppship build | |
| cppship test | |
| - name: Test cppship | |
| run: | | |
| git clone https://github.com/qqiangwu/cppship-examples.git | |
| cd cppship-examples | |
| bash verify.sh |