Skip to content
Snippets Groups Projects
Commit ae5061ba authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
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 f07e1a3f
Branches
Tags
No related merge requests found
...@@ -4,30 +4,56 @@ on: ...@@ -4,30 +4,56 @@ on:
pull_request: pull_request:
branches: branches:
- master - master
push:
branches:
- master
jobs: jobs:
Continuous-Integration: Build-and-Test:
runs-on: ubuntu-latest 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: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
with:
submodules: true
- uses: conda-incubator/setup-miniconda@v2 - uses: conda-incubator/setup-miniconda@v2
with: with:
miniconda-version: "latest" miniconda-version: "latest"
activate-environment: ale activate-environment: ale
environment-file: environment.yml 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 - name: Install Python Package
run: | run: |
python setup.py install python setup.py install
- name: Test Python Package - name: Test Python Package
run: | run: |
pytest tests/pytests -vv pytest --cov-report=xml --cov=ale tests/pytests -vv
- name: Build C++ Package - name: Build C++ Package
run: | run: |
mkdir -p build mkdir -p build
cd build cd build
cmake -DCMAKE_BUILD_TYPE=RELEASE .. cmake -DCMAKE_BUILD_TYPE=RELEASE -DCOVERAGE=ON ..
cmake --build . cmake --build .
- name: Test C++ Package - name: Test C++ Package
run: | run: |
cd build
ctest -VV 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'
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
...@@ -18,5 +18,6 @@ dependencies: ...@@ -18,5 +18,6 @@ dependencies:
- spiceypy>=2.3.0 - spiceypy>=2.3.0
- pyyaml - pyyaml
- pytest - pytest
- pytest-cov
- networkx - networkx
- breathe - breathe
...@@ -5,13 +5,13 @@ import warnings ...@@ -5,13 +5,13 @@ import warnings
import numpy as np import numpy as np
import json import json
import pvl import pvl
from glob import glob
from pathlib import Path
import ale import ale
from ale.base.data_isis import read_table_data from ale.base.data_isis import read_table_data
from glob import glob
class SimpleSpice(): class SimpleSpice():
def scs2e(self, *args): def scs2e(self, *args):
return 0.1 return 0.1
...@@ -73,8 +73,7 @@ def compare_dicts(ldict, rdict): ...@@ -73,8 +73,7 @@ def compare_dicts(ldict, rdict):
differences.append(f'Values of key {key} are not equal {item} : {rdict[key]}.') differences.append(f'Values of key {key} are not equal {item} : {rdict[key]}.')
return differences return differences
ale_root = os.path.split(ale.__file__)[0] data_root = os.path.join(Path(__file__).parent.absolute(), 'data')
data_root = os.path.join(ale_root, '../tests/pytests/data')
dirs = next(os.walk(data_root, topdown=True))[1] dirs = next(os.walk(data_root, topdown=True))[1]
dirs = [d for d in dirs if not d.startswith('.')] dirs = [d for d in dirs if not d.startswith('.')]
image_2_data = {} image_2_data = {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment