From 165a7dd96a54daf9b0b70ec32a422edd65d0e9e9 Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Fri, 18 Dec 2020 09:07:24 -0500 Subject: [PATCH 1/4] Re #315 - Remove travis + switch to GitHub Actions --- .github/workflows/addie_ci.yml | 72 +++++++++++++++++++++++++++++++ .travis.yml | 77 ---------------------------------- README.md | 2 +- requirements-dev.txt | 8 ++-- requirements.txt | 7 ++-- 5 files changed, 80 insertions(+), 86 deletions(-) create mode 100644 .github/workflows/addie_ci.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/addie_ci.yml b/.github/workflows/addie_ci.yml new file mode 100644 index 00000000..9bc5d95f --- /dev/null +++ b/.github/workflows/addie_ci.yml @@ -0,0 +1,72 @@ +name: addie_feature_branch + +env: {} + +on: + push: + branches: + - '*' + +jobs: + + linux: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04] + python-version: ["3.6"] + + steps: + - uses: actions/checkout@v2 + - uses: conda-incubator/setup-miniconda@v2 + with: + auto-update-conda: true + python-version: ${{ matrix.python-version }} + channels: marshallmcdonnell,conda-forge,mantid + + - name: Apt install deps + run: sudo apt-get install xvfb freeglut3-dev libglu1-mesa + + - name: Conda install deps + shell: bash -l {0} + run: | + conda install mantid-workbench + conda install mantid-total-scattering-python-wrapper + conda install --file requirements.txt --file requirements-dev.txt + + - name: Mantid pre-requisites + shell: bash -l {0} + run: | + /sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16 + mkdir ~/.mantid + echo "CheckMantidVersion.OnStartup=0" > ~/.mantid/Mantid.user.properties + echo "UpdateInstrumentDefinitions.OnStartup=0" >> ~/.mantid/Mantid.user.properties + echo "usagereports.enabled=0" >> ~/.mantid/Mantid.user.properties + export DISPLAY=:99.0 + sleep 3 + + - name: Lint + shell: bash -l {0} + run: flake8 . --count + + - name: Test + shell: bash -l {0} + run: | + python -c "import mantid" + python -c "import qtpy" + python -c "import mantidqt" + xvfb-run --server-args="-screen 0 640x480x24" --auto-servernum mantidworkbench --help + echo "import time;time.sleep(5)" > workbenchshutdown.py + xvfb-run --auto-servernum pytest --mpl tests + + - name: Deploy to Anaconda + shell: bash -l {0} + if: startsWith( github.ref, 'refs/tags/v') + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + run: | + conda install -y anaconda-client conda-build conda-verify + cd conda.recipe + conda build --output-folder . . + anaconda upload --label main linux-64/*.tar.bz2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 32934c6c..00000000 --- a/.travis.yml +++ /dev/null @@ -1,77 +0,0 @@ -language: python -dist: trusty - -services: - - xvfb - -cache: - directories: - - $HOME/.cache/pip - -matrix: - include: - - os: linux - env: CONDA=2.7 - - os: linux - env: CONDA=3.6.7 - -before_install: -- | - # Install conda - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x16" - if [ "$TRAVIS_OS_NAME" = "linux" ]; then export CXX=g++-4.8 CC=gcc-4.8; fi - if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi - wget -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda${CONDA:0:1}-latest-$OS.sh - bash miniconda.sh -b -p $HOME/miniconda - export PATH="$HOME/miniconda/bin:$PATH" - conda init bash - -install: - # Setup conda activate/deactivate commands - - conda init bash - - source $(conda info --root)/etc/profile.d/conda.sh - - conda info --root - - # Conda config - behavior and channel setup - - conda config --set always_yes yes --set changeps1 no --set anaconda_upload no - - conda config --add channels conda-forge --add channels marshallmcdonnell --add channels mantid --add channels mantid/label/nightly - -script: - # TEST: Create test environment - - conda create -q -n addie_test python=$CONDA mantid-workbench>=4.2 --file requirements.txt --file requirements-dev.txt - - conda info --envs - - conda activate addie_test - - python --version - - - | - # Mantid pre-requiste - create a properties file that turns off network access - mkdir ~/.mantid - echo "CheckMantidVersion.OnStartup=0" > ~/.mantid/Mantid.user.properties - echo "UpdateInstrumentDefinitions.OnStartup=0" >> ~/.mantid/Mantid.user.properties - echo "usagereports.enabled=0" >> ~/.mantid/Mantid.user.properties - export DISPLAY=:99.0 - sleep 3 - - # lint the code and generate an error if a warning is introduced - - flake8 . --count - - python -c "import mantid" - - # mantid workbench tests - - xvfb-run --server-args="-screen 0 640x480x24" --auto-servernum mantidworkbench --help - - echo "import time;time.sleep(5)" > workbenchshutdown.py - # this requires the mantid-workbench package to be fixed - #- xvfb-run --server-args="-screen 0 640x480x24" --auto-servernum mantidworkbench -q -x workbenchshutdown.py - - # run addie tests - - QT_DEBUG_PLUGINS=1 xvfb-run --server-args="-screen 0 640x480x24" --auto-servernum pytest --mpl tests --disable-pytest-warnings - - -deploy: - # Deploy conda package to Anaconda.org https://anaconda.org/addie-diffraction/addie - - provider: script - script: cd conda.recipe && bash ./anaconda_upload.sh - skip_cleanup: true - skip_existing: true - on: - branch: master - tags: true diff --git a/README.md b/README.md index deed7367..e7669584 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ | CI | Release | |--------|---------| -| [![Build Status](https://travis-ci.org/neutrons/addie.svg?branch=master)](https://travis-ci.org/neutrons/addie) | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/version.svg)](https://anaconda.org/addie-diffraction/addie) | +| | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/version.svg)](https://anaconda.org/addie-diffraction/addie) | | | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/platforms.svg)](https://anaconda.org/addie-diffraction/addie) | ADDIE diff --git a/requirements-dev.txt b/requirements-dev.txt index a6c1257a..a25477ac 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,7 +1,7 @@ flake8 mock -pytest -pytest-mpl -pytest-qt -simplejson +pytest==6.2 +pytest-mpl==0.12 +pytest-qt==3.3 +simplejson==3.17 typing diff --git a/requirements.txt b/requirements.txt index 1da997b3..c325da39 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -mantid-total-scattering periodictable -psutil -qtpy -simplejson +psutil==5.8 +qtpy==1.6 +simplejson==3.17 From e630c71aeb1fa2c6ed75450ea3048c1469b10e5f Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Wed, 23 Dec 2020 16:36:24 -0500 Subject: [PATCH 2/4] Add tags to workflow --- .github/workflows/addie_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/addie_ci.yml b/.github/workflows/addie_ci.yml index 9bc5d95f..6e4af4da 100644 --- a/.github/workflows/addie_ci.yml +++ b/.github/workflows/addie_ci.yml @@ -6,6 +6,8 @@ on: push: branches: - '*' + tags: + - 'v*' jobs: From 6c7995478d26a356c9942f37ccf11bba447ffd57 Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Wed, 23 Dec 2020 17:13:31 -0500 Subject: [PATCH 3/4] Remove anaconda upload script --- conda.recipe/anaconda_upload.sh | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 conda.recipe/anaconda_upload.sh diff --git a/conda.recipe/anaconda_upload.sh b/conda.recipe/anaconda_upload.sh deleted file mode 100644 index c48b1110..00000000 --- a/conda.recipe/anaconda_upload.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - - -conda install conda-build conda-verify anaconda-client -conda build . - -export PKG_PATH=$(conda build . --output) -PKG_FILE=$(basename ${PKG_PATH}) -echo ${PKG_FILE} -echo ${PKG_PATH} - -echo "Uploading ${PKG_PATH} artifact..." -anaconda -v -t ${CONDA_UPLOAD_TOKEN} upload ${PKG_PATH} --force - -echo "Successfully deployed ${PKG_FILE} to Anaconda.org." From c96a679e9aa5a065b10c94f90c471ed588fe0ad6 Mon Sep 17 00:00:00 2001 From: Marshall McDonnell Date: Wed, 23 Dec 2020 17:13:41 -0500 Subject: [PATCH 4/4] Add the GitHub Actions badge to README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e7669584..983987f0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ | CI | Release | |--------|---------| -| | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/version.svg)](https://anaconda.org/addie-diffraction/addie) | +| [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fneutrons%2Faddie%2Fbadge&style=plastic)](https://actions-badge.atrox.dev/neutrons/addie/goto) | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/version.svg)](https://anaconda.org/addie-diffraction/addie) | | | [![Anaconda-Server Badge](https://anaconda.org/addie-diffraction/addie/badges/platforms.svg)](https://anaconda.org/addie-diffraction/addie) | ADDIE