diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85542c2442..29aa92214c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,8 @@ name: CI -on: [push, pull_request] +on: + push: + branches: [develop] + pull_request: env: CXXFLAGS: "-fprofile-arcs -ftest-coverage" @@ -9,6 +12,7 @@ jobs: name: "Python ${{ matrix.python-version }} / ${{ matrix.os }}" runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: python-version: ["2.7", "3.6"] os: [ubuntu-18.04] @@ -16,24 +20,30 @@ jobs: env: CC: ${{ matrix.compiler }} PY2: ${{ startsWith(matrix.python-version, 2) && 'on' || 'off' }} + BUILD: "-j 2 IMP.kernel IMP.test IMP.core IMP.algebra IMP.container" + PERCPP: "kernel" steps: - uses: actions/checkout@v2 + with: + fetch-depth: 2 - name: Install dependencies run: | sudo apt-get update -qq sudo apt-get install -qq libboost-all-dev swig libhdf5-serial-dev libeigen3-dev \ - cmake libcgal-dev libcgal-qt5-dev \ - libfftw3-dev libopencv-dev libgsl0-dev libann-dev \ - libprotobuf-dev protobuf-compiler \ - libopenmpi-dev + cmake libcgal-dev libcgal-qt5-dev libfftw3-dev libopencv-dev libgsl0-dev \ + libann-dev libprotobuf-dev protobuf-compiler libopenmpi-dev if [ "${{ env.PY2 }}" == "on" ] then sudo apt-get install -qq python-dev python-numpy python-protobuf \ - python-nose python-pip python-biopython + python-coverage python-pip \ + python-biopython python-pytest-xdist \ + python-pytest-cov export PIP=pip2 else sudo apt-get install -qq python3-dev python3-numpy python3-protobuf \ - python3-nose python3-pip python3-biopython + python3-coverage python3-pip \ + python3-biopython python3-pytest-xdist \ + python3-pytest-cov export PIP=pip3 fi $PIP install codecov @@ -43,5 +53,21 @@ jobs: run: | mkdir build cd build - cmake .. -DUSE_PYTHON2=${{ env.PY2 }} -DCMAKE_CXX_FLAGS="${{ env.CXXFLAGS }}" -DCGAL_DIR=/usr/lib/x86_64-linux-gnu/cmake/CGAL/ - make -k -j 2 + cmake .. -DUSE_PYTHON2=${{ env.PY2 }} -DCMAKE_CXX_FLAGS="${{ env.CXXFLAGS }}" \ + -DCGAL_DIR=/usr/lib/x86_64-linux-gnu/cmake/CGAL/ \ + -DIMP_PER_CPP_COMPILATION=${{ env.PERCPP }} + make -k ${{ env.BUILD }} + - name: Run tests + run: | + if [ "${{ env.PY2 }}" == "on" ]; then + export PYTEST=pytest + else + export PYTEST=pytest-3 + fi + cd build + ./setup_environment.sh $PYTEST --cov=.. --cov-report=xml --cov-branch --forked ../modules/kernel/test/test_*.py + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v1 + with: + fail_ci_if_error: false + directory: build diff --git a/modules/kernel/test/test_progress.py b/modules/kernel/test/test_progress.py index 196bd3b2aa..3a61248c55 100644 --- a/modules/kernel/test/test_progress.py +++ b/modules/kernel/test/test_progress.py @@ -1,14 +1,21 @@ import IMP +import IMP.test import sys -IMP.set_deprecation_exceptions(True) -IMP.setup_from_argv(sys.argv, "Test progress bar") -IMP.set_log_level(IMP.PROGRESS) -IMP.set_progress_display("Test progress", 110) -for i in range(0, 110, 5): - IMP.add_to_progress_display(5) +class Tests(IMP.test.TestCase): -IMP.set_progress_display("Test progress round 2", 130) -for i in range(0, 130, 5): - IMP.add_to_progress_display(5) + def test_progress(self): + """Test progress bar""" + IMP.set_log_level(IMP.PROGRESS) + IMP.set_progress_display("Test progress", 110) + for i in range(0, 110, 5): + IMP.add_to_progress_display(5) + + IMP.set_progress_display("Test progress round 2", 130) + for i in range(0, 130, 5): + IMP.add_to_progress_display(5) + + +if __name__ == '__main__': + IMP.test.main()