v0.2.2 #692
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
| # This is a basic workflow to help you get started with Actions | |
| name: Unit Tests | |
| # Controls when the workflow will run | |
| on: | |
| # Triggers the workflow on push or pull request events | |
| push: | |
| branches: | |
| - "*" | |
| - "*/*" | |
| - "**" | |
| pull_request: | |
| branches: | |
| - "**" | |
| types: | |
| - opened | |
| - synchronize | |
| - reopened | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| # A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
| jobs: | |
| # This workflow contains a single job called "build" | |
| build: | |
| # The type of runner that the job will run on | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| # Set fail-fast to false to ensure that feedback is delivered for all matrix combinations. Consider changing this to true when your workflow is stable. | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest, windows-latest] | |
| build_type: [Debug, Release] | |
| include: | |
| - os: ubuntu-latest | |
| c_compiler: clang | |
| cpp_compiler: clang++ | |
| - os: macos-latest | |
| c_compiler: clang | |
| cpp_compiler: clang++ | |
| - os: windows-latest | |
| c_compiler: MSVC | |
| cpp_compiler: MSVC | |
| # Steps represent a sequence of tasks that will be executed as part of the job | |
| steps: | |
| # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: Set reusable strings | |
| # Turn repeated input strings (such as the build output directory) into step outputs. These step outputs can be used throughout the workflow file. | |
| id: strings | |
| shell: bash | |
| run: | | |
| echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT" | |
| - name: Setup cmake | |
| uses: jwlawson/actions-setup-cmake@v2 | |
| with: | |
| cmake-version: "3.28.x" | |
| - name: Install cvxpy | |
| run: > | |
| pip install cvxpy | |
| - name: Setup MSVC (Windows only) | |
| if: runner.os == 'Windows' | |
| uses: ilammy/msvc-dev-cmd@v1 | |
| - name: Configure CMake | |
| # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. | |
| # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type | |
| run: > | |
| cmake -B ${{ steps.strings.outputs.build-output-dir }} | |
| -DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} | |
| -DCMAKE_C_COMPILER=${{ matrix.c_compiler }} | |
| -DQOCO_BUILD_TYPE:STR=${{ matrix.build_type }} | |
| -S ${{ github.workspace }} -DENABLE_TESTING:BOOL=True | |
| - name: Check Config | |
| run: > | |
| cat "${{ github.workspace }}/include/qoco_config.h" | |
| - name: Build on Windows | |
| if: matrix.os == 'windows-latest' | |
| # Build your program with the given configuration. | |
| run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }} | |
| - name: Build on Mac or Ubuntu | |
| if: matrix.os == 'macos-latest' || matrix.os == 'ubuntu-latest' | |
| # Build your program with the given configuration. | |
| run: cmake --build ${{ steps.strings.outputs.build-output-dir }} | |
| - name: Test | |
| working-directory: ${{ steps.strings.outputs.build-output-dir }} | |
| run: ctest --test-dir ${{ steps.strings.outputs.build-output-dir }} --verbose -C ${{ matrix.build_type }} --rerun-failed --output-on-failure |