Commit 71893e4e authored by Jesse Mapel's avatar Jesse Mapel
Browse files

Getting github actions CI working (#412)

* Update ci_testing.yml

* Added flag to not activate base

* Added default to bash shell

* Update ci_testing.yml

* Removed os walk to get data dir

* Add submodule checkout

* Run ctest in build directory

* Added build matrix

* Disabled fast-fail

* Axe python 3.6 build

* Adding coveralls step

* Switching to codecov.io

* Axed Travis and added Python coverage

* Added pytest-cov

* Only upload coverage once

* Testing adding windows

* Disabled windows pytest for now

* Testing different Python component

* Removed windows CI for now

* Trigger on push
parent 9817ea21
Loading
Loading
Loading
Loading
+31 −5
Original line number Diff line number Diff line
@@ -4,30 +4,56 @@ on:
  pull_request:
    branches:
      - master
  push:
    branches:
      - master

jobs:
  Continuous-Integration:
    runs-on: ubuntu-latest
  Build-and-Test:
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
       os: [ubuntu-latest, macos-latest]
       python-version: ["3.7", "3.8", "3.9"]
    defaults:
      run:
        shell: bash -l {0}
    steps:
      - uses: actions/checkout@v2
        with:
          submodules: true
      - uses: conda-incubator/setup-miniconda@v2
        with:
          miniconda-version: "latest"
          activate-environment: ale
          environment-file: environment.yml
          auto-activate-base: false
          auto-update-conda: true
          python-version: ${{ matrix.python-version }}
      - name: Check build environment
        run: |
          conda list
      - name: Install Python Package
        run: |
          python setup.py install
      - name: Test Python Package
        run: |
           pytest tests/pytests -vv
           pytest --cov-report=xml --cov=ale tests/pytests -vv
      - name: Build C++ Package
        run: |
          mkdir -p build
          cd build
          cmake -DCMAKE_BUILD_TYPE=RELEASE ..
          cmake -DCMAKE_BUILD_TYPE=RELEASE -DCOVERAGE=ON ..
          cmake --build .
      - name: Test C++ Package
        run: |
          cd build
          ctest -VV
      - name: Upload Coverage
        uses: codecov/codecov-action@v1
        with:
          token: ${{ secrets.CODECOV_TOKEN }}
          fail_ci_if_error: true
          verbose: true
        if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9'

.travis.yml

deleted100644 → 0
+0 −61
Original line number Diff line number Diff line
language: cpp
sudo: false

branches:
  only:
    - master

matrix:
  include:
    - os: linux
      addons:
        apt:
          sources:
            - ubuntu-toolchain-r-test
          packages:
            - g++-7
      env:
        - MATRIX_EVAL="CXX=g++-7 && CC=gcc-7"
    - os: osx
      osx_image: xcode9.4
      env:
        - MATRIX_EVAL="CXX=clang++ && CC=clang"

before_install:
  - echo "$TRAVIS_PULL_REQUEST"
  - eval "${MATRIX_EVAL}"
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      pip install --user cpp-coveralls;
    fi

install:
  # Install a supported cmake version (>= 3.10)
  - |
    if [ "$TRAVIS_OS_NAME" == "linux" ]; then
      wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;
    else
      curl -o miniconda.sh  https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh;
    fi
  - bash miniconda.sh -b -p $HOME/miniconda
  - export PATH="$HOME/miniconda/bin:$PATH"
  - conda config --set always_yes yes
  - conda env create -n ale
  - conda env update -f environment.yml -n ale
  - source activate ale
  - conda install pytest

script:
  - PYTHONPATH=. pytest tests/pytests -vv
  - python setup.py install # install to use python lib in c code
  - mkdir -p build
  - cd build
  - cmake -DCMAKE_BUILD_TYPE=RELEASE -DCOVERAGE=ON ..
  - cmake --build .
  - ctest -VV

after_success:
  - |
    if [ "$TRAVIS_OS_NAME" == linux ]; then
      coveralls --root $(dirname $PWD) -i src/ --verbose;
    fi
+1 −0
Original line number Diff line number Diff line
@@ -18,5 +18,6 @@ dependencies:
  - spiceypy>=2.3.0
  - pyyaml
  - pytest
  - pytest-cov
  - networkx
  - breathe
+3 −4
Original line number Diff line number Diff line
@@ -5,13 +5,13 @@ import warnings
import numpy as np
import json
import pvl
from glob import glob
from pathlib import Path

import ale

from ale.base.data_isis import read_table_data

from glob import glob

class SimpleSpice():
    def scs2e(self, *args):
        return 0.1
@@ -73,8 +73,7 @@ def compare_dicts(ldict, rdict):
                differences.append(f'Values of key {key} are not equal {item} : {rdict[key]}.')
    return differences

ale_root = os.path.split(ale.__file__)[0]
data_root = os.path.join(ale_root, '../tests/pytests/data')
data_root = os.path.join(Path(__file__).parent.absolute(), 'data')
dirs = next(os.walk(data_root, topdown=True))[1]
dirs = [d for d in dirs if not d.startswith('.')]
image_2_data = {}