From 526c00dfc160ed427b804dbcb65d4b3a9ac170ae Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:29:50 -0500 Subject: [PATCH 01/14] remove travis; add first github action workflow --- .github/workflows/build.yml | 77 +++++++++++++++++++++++++++++++++++++ .travis.yml | 72 ---------------------------------- 2 files changed, 77 insertions(+), 72 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..171461c --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,77 @@ +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} + + 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: conda install dependencies + run: | + conda install -c anaconda setuptools + conda install stsci coverage + + +############################ + +# 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 + +#env: +# global: +# # SET DEFAULTS TO AVOID REPEATING IN MOST CASES +# # For now dark monitor path is set as blank +# - 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' + + + # 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 + 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 From 704d9ec9430a6e75e51bdcf95ed651dcf49b335e Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:42:23 -0500 Subject: [PATCH 02/14] added step to install from source --- .github/workflows/build.yml | 51 +++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 171461c..835ecc6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,9 +5,20 @@ on: pull_request: env: - # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES + CRDS_SERVER_URL: 'https://hst-crds.stsci.edu' + DARK_PROGRAMS: + MONITOR_CONFIG: '$GITHUB_WORKSPACE/tests/cosmoconfig_test.yaml' + # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES PYTHONIOENCODING: UTF8 +# - +# - +# - 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_PATH='/home/travis/build/spacetelescope/cosmo/tests/data/test_crds_cache' + jobs: build: name: build and install from source @@ -27,10 +38,19 @@ jobs: python-version: '3.7' channels: http://ssb.stsci.edu/astroconda - - name: conda install dependencies + - name: install dependencies run: | conda install -c anaconda setuptools - conda install stsci coverage + conda install stsci coverage sphinx + pip install codecov + + - name: install from source + run: pip install . + + - name: run tests + run: coverage run -m pytest + + ############################ @@ -44,34 +64,9 @@ jobs: # - texlive-latex-extra # - dvipng -#env: -# global: -# # SET DEFAULTS TO AVOID REPEATING IN MOST CASES -# # For now dark monitor path is set as blank -# - 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' - - # 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 From feff85f0f4d299d6adb24ffded1acff5052aa329 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:44:07 -0500 Subject: [PATCH 03/14] try to fix quotes on env vars --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 835ecc6..39ccc40 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,7 @@ on: env: CRDS_SERVER_URL: 'https://hst-crds.stsci.edu' DARK_PROGRAMS: - MONITOR_CONFIG: '$GITHUB_WORKSPACE/tests/cosmoconfig_test.yaml' + MONITOR_CONFIG: $GITHUB_WORKSPACE/tests/cosmoconfig_test.yaml # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES PYTHONIOENCODING: UTF8 From 78e4afc495cf4bdf506ca0ca1057d5d6f2679860 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:46:03 -0500 Subject: [PATCH 04/14] try to fix quotes on env vars again --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 39ccc40..96c7035 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,7 +7,6 @@ on: env: CRDS_SERVER_URL: 'https://hst-crds.stsci.edu' DARK_PROGRAMS: - MONITOR_CONFIG: $GITHUB_WORKSPACE/tests/cosmoconfig_test.yaml # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES PYTHONIOENCODING: UTF8 @@ -26,6 +25,8 @@ jobs: defaults: run: shell: bash -l {0} + env: + MONITOR_CONFIG: $GITHUB_WORKSPACE/tests/cosmoconfig_test.yaml steps: - name: checkout code From 0d35b8e4eb9edf10e3425ad7858031a5baed5a0d Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:49:02 -0500 Subject: [PATCH 05/14] try to fix quotes on env vars third time --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 96c7035..9cf2535 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: run: shell: bash -l {0} env: - MONITOR_CONFIG: $GITHUB_WORKSPACE/tests/cosmoconfig_test.yaml + MONITOR_CONFIG: ${{ env.GITHUB_WORKSPACE }}/tests/cosmoconfig_test.yaml steps: - name: checkout code From 41e64dc334d1a99ee2d1a57a86943540047f37df Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:49:48 -0500 Subject: [PATCH 06/14] try to fix quotes on env vars fourth time --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cf2535..83f85a7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: run: shell: bash -l {0} env: - MONITOR_CONFIG: ${{ env.GITHUB_WORKSPACE }}/tests/cosmoconfig_test.yaml + MONITOR_CONFIG: ${{ GITHUB_WORKSPACE }}/tests/cosmoconfig_test.yaml steps: - name: checkout code From 1520fe11854686bf602375d7ba5a4c6a8cf87bcf Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:51:34 -0500 Subject: [PATCH 07/14] try to fix quotes on env vars fifth time --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 83f85a7..0bf44cd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,7 +26,7 @@ jobs: run: shell: bash -l {0} env: - MONITOR_CONFIG: ${{ GITHUB_WORKSPACE }}/tests/cosmoconfig_test.yaml + MONITOR_CONFIG: ${{ github.workspace }}/tests/cosmoconfig_test.yaml steps: - name: checkout code From 9d47dc4adfc21c463d5a849adb32218828f72029 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:55:24 -0500 Subject: [PATCH 08/14] move all env vars --- .github/workflows/build.yml | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0bf44cd..1997c80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,19 +5,9 @@ on: pull_request: env: - CRDS_SERVER_URL: 'https://hst-crds.stsci.edu' - DARK_PROGRAMS: # USE UTF8 ENCODING. SHOULD BE DEFAULT, BUT THIS IS INSURANCE AGAINST FUTURE CHANGES PYTHONIOENCODING: UTF8 -# - -# - -# - 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_PATH='/home/travis/build/spacetelescope/cosmo/tests/data/test_crds_cache' - jobs: build: name: build and install from source @@ -26,6 +16,13 @@ jobs: 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: From 8bd24d68a4c8d03b811b58a08d93fa1b268fade4 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 12:56:29 -0500 Subject: [PATCH 09/14] removed errant quotes --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1997c80..4c96bae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,10 +16,10 @@ jobs: 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' + 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: From 5c4594b3c094d55e143beb950a59ea665a978377 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 16 Dec 2021 14:10:25 -0500 Subject: [PATCH 10/14] add back in codecov --- .github/workflows/build.yml | 27 +++++---------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4c96bae..f97294b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,8 +39,7 @@ jobs: - name: install dependencies run: | conda install -c anaconda setuptools - conda install stsci coverage sphinx - pip install codecov + conda install stsci coverage - name: install from source run: pip install . @@ -48,23 +47,7 @@ jobs: - name: run tests run: coverage run -m pytest - - - -############################ - -# 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 - - # DOCUMENTATION DEPENDENCIES -# - if [[ $SETUP_CMD == build_sphinx* ]]; then conda install numpy=$NUMPY_VERSION $CONDA_DOC_DEPS; fi - - -#after_success: codecov - + - name: run codecov + uses: codecov/codecov-action@v2 + with: + verbose: true From 52dc8063f362c7ba69efd67ad1bef90cec7f158a Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 23 Dec 2021 14:44:32 -0500 Subject: [PATCH 11/14] whitespace fixes on build.yml --- .github/workflows/build.yml | 50 ++++++++++++++++++------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f97294b..d0a3143 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,28 +26,28 @@ jobs: 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 - - - name: install from source - run: pip install . - - - name: run tests - run: coverage run -m pytest - - - name: run codecov - uses: codecov/codecov-action@v2 - with: - verbose: true + - 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 + + - name: install from source + run: pip install . + + - name: run tests + run: coverage run -m pytest + + - name: run codecov + uses: codecov/codecov-action@v2 + with: + verbose: true From 57a1c58cf980ed00be95237fa4a34c50ebde7353 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 23 Dec 2021 15:06:06 -0500 Subject: [PATCH 12/14] added codecov name --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d0a3143..6dc7999 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -51,3 +51,4 @@ jobs: uses: codecov/codecov-action@v2 with: verbose: true + name: cosmo-codecov From bb46ce714addd46decf7d38f4204a44bef4d8158 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 23 Dec 2021 15:22:28 -0500 Subject: [PATCH 13/14] dropping codecov github action to see if cli works --- .github/workflows/build.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6dc7999..363c37f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -48,7 +48,4 @@ jobs: run: coverage run -m pytest - name: run codecov - uses: codecov/codecov-action@v2 - with: - verbose: true - name: cosmo-codecov + run: codecov From a06c5282a3e9e367737f85d5577890cfebb787d7 Mon Sep 17 00:00:00 2001 From: Joshua Neuheisel Date: Thu, 23 Dec 2021 15:27:26 -0500 Subject: [PATCH 14/14] install missing codecov package --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 363c37f..079bfcf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,6 +40,7 @@ jobs: run: | conda install -c anaconda setuptools conda install stsci coverage + pip install codecov - name: install from source run: pip install .