Skip to content
# Author: Humberto Munoz Bauza ([email protected])
#
# Copyright © 2023, United States Government, as represented by the Administrator
# of the National Aeronautics and Space Administration. All rights reserved.
#
# The PySA, a powerful tool for solving optimization problems is licensed under
# the Apache License, Version 2.0 (the "License"); you may not use this file
# except in compliance with the License. You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0.
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
name: branching-tests
on:
push:
branches: [ "pysa-dpll" ]
pull_request:
branches: [ "pysa-dpll" ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest, macos-latest ]
build_type: [ Release, Debug ]
cpp_compiler: [ g++, clang++ ]
mpi: [ ON, OFF ]
exclude:
- os: macos-latest
cpp_compiler: g++
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install dependencies
if: matrix.os == 'ubuntu-latest' && matrix.mpi == 'ON'
run: |
sudo apt install -y libopenmpi-dev
- name: Install dependencies
if: matrix.os == 'macos-latest' && matrix.mpi == 'ON'
run: |
brew install mpich
- name: Install and Test Python CUI (MPI)
if: matrix.mpi == 'ON'
run: |
pip install -U pip pybind11
USE_MPI=1 CXX=${{ matrix.cpp_compiler }} pip install -U . --verbose
echo -e 'p cnf 2 2\n1 2 0\n-1 -2 0' | mpirun -n 2 pysa-dpll sat
- name: Install and Test Python CUI
if: matrix.mpi == 'OFF'
run: |
pip install -U pip pybind11
CXX=${{ matrix.cpp_compiler }} pip install -U . --verbose
echo -e 'p cnf 2 2\n1 2 0\n-1 -2 0' | pysa-dpll sat
- name: Configure CMake
run: >
CXX=${{ matrix.cpp_compiler }} \
cmake -B ${{ github.workspace }}/build \
-S ${{ github.workspace }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
-Dpybind11_DIR=$( python -m pybind11 --cmakedir ) \
-DMPI=${{ matrix.mpi }}
- name: Build
run: cmake --build ${{ github.workspace }}/build
--config ${{ matrix.build_type }}
- name: Test
working-directory: ${{ github.workspace }}/build/tests
run: ctest -C ${{ matrix.build_type }} --rerun-failed --output-on-failure