diff --git a/.github/workflows/ci_testing.yml b/.github/workflows/ci_testing.yml new file mode 100644 index 0000000000000000000000000000000000000000..c639894a71385b9947fdfd3abf0c6b6716f5a71b --- /dev/null +++ b/.github/workflows/ci_testing.yml @@ -0,0 +1,53 @@ +name: Pull-Request-CI + +on: + pull_request: + branches: + - dev + push: + branches: + - dev + +jobs: + 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: usgscsm + 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: Build Package + run: | + mkdir -p build + cd build + cmake -DCMAKE_BUILD_TYPE=RELEASE -DCOVERAGE=ON .. + cmake --build . + - name: Test 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' diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 258784ec9aad43aae67a29d978a1b1c3f4b22d05..0000000000000000000000000000000000000000 --- a/.travis.yml +++ /dev/null @@ -1,67 +0,0 @@ -language: cpp -sudo: false - -branches: - only: - - master - - dev - -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.anaconda.com/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 - - source $HOME/miniconda/etc/profile.d/conda.sh - - conda env create -n usgscsm -f environment.yml - -script: - - conda activate usgscsm - - mkdir build - - cd build - - cmake -DUSGSCSM_EXTERNAL_DEPS=ON -DCOVERAGE=ON .. - - cmake --build . - - ctest -VV - - cd .. - -after_success: - - conda install -y -q conda-build anaconda-client - # Pull the libcsm for the build from our anaconda channel - - conda config --add channels usgs-astrogeology - - conda config --set anaconda_upload no - - conda build recipe -q - # Get the conda build output dir - - builddir=(`conda build recipe --output`) - # Label based on the branch and upload to anaconda.org - - | - if [ "$TRAVIS_BRANCH" == "master" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - anaconda -t="$CONDA_UPLOAD_TOKEN" upload $builddir; - elif [ "$TRAVIS_BRANCH" == "dev" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ]; then - anaconda -t="$CONDA_UPLOAD_TOKEN" upload $builddir --label dev --force; - fi