diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..079bfcf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,52 @@ +name: build + +on: + push: + pull_request: + +env: + # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES + PYTHONIOENCODING: UTF8 + +jobs: + build: + name: build and install from source + runs-on: ubuntu-latest + defaults: + run: + shell: bash -l {0} + env: + COSMO_FILES_SOURCE: ${{ github.workspace }}/tests/data + COSMO_OUTPUT: ${{ github.workspace }}/tests + COSMO_SMS_DB: ${{ github.workspace }}/tests/test.db + COSMO_SMS_SOURCE: ${{ github.workspace }}/tests/data + CRDS_SERVER_URL: 'https://hst-crds.stsci.edu' + CRDS_PATH: ${{ github.workspace }}/tests/data/test_crds_cache + DARK_PROGRAMS: + MONITOR_CONFIG: ${{ github.workspace }}/tests/cosmoconfig_test.yaml + + steps: + - name: checkout code + uses: actions/checkout@v2 + + - name: install conda + uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: '3.7' + channels: http://ssb.stsci.edu/astroconda + + - name: install dependencies + run: | + conda install -c anaconda setuptools + conda install stsci coverage + pip install codecov + + - name: install from source + run: pip install . + + - name: run tests + run: coverage run -m pytest + + - name: run codecov + run: codecov diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 68d7cd3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,72 +0,0 @@ -dist: xenial -language: python -python: "3.7" - -compiler: gcc - -# Setting sudo to false opts in to Travis-CI container-based builds. -sudo: false - -# The apt packages below are needed for sphinx builds, which can no longer -# be installed with sudo apt-get. -addons: - apt: - packages: - - graphviz - - texlive-latex-extra - - dvipng - -os: linux - -env: - global: - # SET DEFAULTS TO AVOID REPEATING IN MOST CASES - # For now dark monitor path is set as blank - - CONDA_ARGS='--quiet' - - CONDA_INSTALL="conda install $CONDA_ARGS" - - CONDA_DEPS='stsci coverage' - - CONDA_DOC_DEPS="$CONDA_DEPS sphinx" - - SETUP_CMD='test' - - MONITOR_CONFIG='/home/travis/build/spacetelescope/cosmo/tests/cosmoconfig_test.yaml' - - DARK_PROGRAMS='' - - COSMO_FILES_SOURCE='/home/travis/build/spacetelescope/cosmo/tests/data' - - COSMO_SMS_SOURCE='/home/travis/build/spacetelescope/cosmo/tests/data' - - COSMO_OUTPUT='/home/travis/build/spacetelescope/cosmo/tests' - - COSMO_SMS_DB='/home/travis/build/spacetelescope/cosmo/tests/test.db' - - CRDS_SERVER_URL='https://hst-crds.stsci.edu' - - CRDS_PATH='/home/travis/build/spacetelescope/cosmo/tests/data/test_crds_cache' - -install: - # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES - - export PYTHONIOENCODING=UTF8 - - # Install conda - - # http://conda.pydata.org/docs/travis.html#the-travis-yml-file - - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; - - bash miniconda.sh -b -p $HOME/miniconda - - export PATH="$HOME/miniconda/bin:$PATH" - - hash -r - - conda config --set always_yes yes --set changeps1 no - - conda config --add channels http://ssb.stsci.edu/astroconda - - conda install -c anaconda setuptools # Add setuptools install - - conda update -q -n base -c defaults conda # Update base packages - - conda info -a # Check the environment in case there are any issues - - # Create and activate the test environment - - conda create $CONDA_ARGS -n test python=$TRAVIS_PYTHON_VERSION $AP_SELECT $NP_SELECT $CR_SELECT $CONDA_DEPS - - source activate test - - # DOCUMENTATION DEPENDENCIES - - if [[ $SETUP_CMD == build_sphinx* ]]; then $CONDA_INSTALL numpy=$NUMPY_VERSION $CONDA_DOC_DEPS; fi - - # Codecov - - pip install codecov - - # Install package with pip - - pip install . - -script: - - coverage run -m pytest - -after_success: codecov