diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..21ce58748 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,77 @@ +name: Empress CI + +# Controls when the action will run. +on: + # Triggers the workflow on pull request events but only on the master branch + pull_request: + branches: [ master ] + +jobs: + # name of job + build: + # The type of runner that the job will run on (available options are window/macOS/linux) + runs-on: ubuntu-latest + # we can add more versions of node.js in the future + strategy: + matrix: + node-version: [14.x] + + # used in McHelper (similar to TRAVIS_PULL_REQUEST variable) + env: + BRANCH_NUMBER: ${{ github.event.number }} + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # first grab branch from github + - uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + + - name: Set up Node.js enviroment + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Install Node.js modules + run: npm install -g qunit-puppeteer jshint prettier@2.0.5 + + - name: Install flake8 + run: conda run -n base pip install flake8 + + - name: Run linters + run: | + conda run -n base make stylecheck + + - name: Set up conda + uses: s-weigand/setup-conda@v1 + with: + update-conda: true + python-version: 3.6 + conda-channels: anaconda, conda-forge + + - name: Create Qiime enviroment + run: | + wget https://data.qiime2.org/distro/core/qiime2-2020.6-py36-linux-conda.yml + conda env create -n qiime2-dev --file qiime2-2020.6-py36-linux-conda.yml + + - name: Install Empress + run: | + conda run -n qiime2-dev pip uninstall emperor --yes + conda run -n qiime2-dev pip install -e .[all] --verbose + conda run -n qiime2-dev qiime dev refresh-cache + + - name: Run tests + run: conda run -n qiime2-dev make test + + - name: Check development script + run: | + conda run -n qiime2-dev ./tests/python/make-dev-page.py + conda run -n qiime2-dev ./tests/python/make-dev-page.py docs/moving-pictures/rooted-tree.qza docs/moving-pictures/table.qza docs/moving-pictures/sample_metadata.tsv docs/moving-pictures/taxonomy.qza + conda run -n qiime2-dev ./tests/python/make-dev-page.py docs/moving-pictures/rooted-tree.qza docs/moving-pictures/table.qza docs/moving-pictures/sample_metadata.tsv docs/moving-pictures/taxonomy.qza docs/moving-pictures/unweighted_unifrac_pcoa_results.qza --filter-extra-samples + conda run -n qiime2-dev ./tests/python/make-dev-page.py docs/moving-pictures/rooted-tree.qza docs/moving-pictures/table.qza docs/moving-pictures/sample_metadata.tsv docs/moving-pictures/taxonomy.qza docs/moving-pictures/biplot.qza --filter-extra-samples + + # - name: Upload to McHelper + # run: | + # conda run -n qiime2-dev make docs + # conda run -n qiime2-dev curl -POST -F "files[]=@${PWD}/docs/moving-pictures/plain.qzv" -F "files[]=@${PWD}/docs/moving-pictures/just-fm.qzv" -F "files[]=@${PWD}/docs/moving-pictures/empress-tree.qzv" -F "files[]=@${PWD}/docs/moving-pictures/empire.qzv" -F "files[]=@${PWD}/docs/moving-pictures/empire-biplot.qzv" http://mchelper.ucsd.edu:8888/uploads/empress/${{env.BRANCH_NUMBER}}/ diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 3b6db0ca7..000000000 --- a/.travis.yml +++ /dev/null @@ -1,46 +0,0 @@ -language: node_js -node_js: - - "14" -dist: trusty -# Note: if you switch to sudo: false, you'll need to launch Chrome with --no-sandbox. -# See https://github.com/travis-ci/travis-ci/issues/8836 -sudo: required -addons: - chrome: stable # have Travis install Chrome stable -before_install: - - wget https://repo.continuum.io/miniconda/Miniconda2-latest-Linux-x86_64.sh -O miniconda.sh && chmod +x miniconda.sh - - ./miniconda.sh -b - - export PATH=/home/travis/miniconda2/bin:$PATH - # Update conda itself - - conda update --yes conda - # Install the latest QIIME 2 version. These lines copied from - # https://github.com/biocore/qurro/blob/d71f55b82f427c0d7d3db80bfd629e2ae1b6a335/.travis.yml. - - wget https://raw.githubusercontent.com/qiime2/environment-files/master/latest/staging/qiime2-latest-py36-linux-conda.yml - - travis_retry conda env create -n qiime2-dev --file qiime2-latest-py36-linux-conda.yml - - source activate qiime2-dev -install: - - pip uninstall emperor --yes - - pip install -e .[all] --verbose - - npm install -g qunit-puppeteer jshint prettier@2.0.5 -script: - - qiime dev refresh-cache - - make test - - make stylecheck - # check the development script works in the 3 possible modes (no inputs, tree - # plot inputs, and tandem plot inputs) - - ./tests/python/make-dev-page.py - - ./tests/python/make-dev-page.py docs/moving-pictures/rooted-tree.qza docs/moving-pictures/table.qza docs/moving-pictures/sample_metadata.tsv docs/moving-pictures/taxonomy.qza - - ./tests/python/make-dev-page.py docs/moving-pictures/rooted-tree.qza docs/moving-pictures/table.qza docs/moving-pictures/sample_metadata.tsv docs/moving-pictures/taxonomy.qza docs/moving-pictures/unweighted_unifrac_pcoa_results.qza --filter-extra-samples - - ./tests/python/make-dev-page.py docs/moving-pictures/rooted-tree.qza docs/moving-pictures/table.qza docs/moving-pictures/sample_metadata.tsv docs/moving-pictures/taxonomy.qza docs/moving-pictures/biplot.qza --filter-extra-samples - - make docs -after_success: - - if [ ${TRAVIS_PULL_REQUEST} == "false" ]; then export TRAVIS_PULL_REQUEST=${TRAVIS_BRANCH} ; fi - - echo ${TRAVIS_PULL_REQUEST} - # now we can upload the files to mchelper - - > - curl -POST -F "files[]=@${PWD}/docs/moving-pictures/plain.qzv" - -F "files[]=@${PWD}/docs/moving-pictures/just-fm.qzv" - -F "files[]=@${PWD}/docs/moving-pictures/empress-tree.qzv" - -F "files[]=@${PWD}/docs/moving-pictures/empire.qzv" - -F "files[]=@${PWD}/docs/moving-pictures/empire-biplot.qzv" - http://mchelper.ucsd.edu:8888/uploads/empress/${TRAVIS_PULL_REQUEST}/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 029067529..95cb8672c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,8 +9,7 @@ addition, make sure to periodically update to the latest development version of Emperor using `pip install git+https://github.com/biocore/emperor.git`. You will also need to install a few Node.js packages in order to test Empress' -JavaScript code. The `.travis.yml` file (under the `install` section) shows -how to install these packages: essentially, you'll just need to run +JavaScript code. ```bash npm install -g qunit-puppeteer jshint prettier@2.0.5 @@ -67,7 +66,7 @@ make stylecheck to see if your code passes these checks. -**`make stylecheck` will be run on Travis-CI**, so it's useful to run this +**`make stylecheck` will be run on GitHub Actions**, so it's useful to run this periodically while developing to make sure that your code looks good (and so you can address any issues as they come up, rather than all at once when trying to submit a pull request). diff --git a/Makefile b/Makefile index d2631725d..a2765461c 100644 --- a/Makefile +++ b/Makefile @@ -3,8 +3,11 @@ # Empress ("make test", run style-checking ("make stylecheck"), auto-format the # JS code ("make jsstyle"), etc. # -# Requires that a few command-line utilities are installed; see the Travis-CI -# config file (.travis.yml) for examples of installing these utilities. +# Running the follow requires the following npm packages: qunit-puppeteer, +# jshint, prettier@2.0.5. In addition, you will need a working version of flake8 +# in your conda env. Note: if you are having difficulties getting qunit to +# to run, you can simply load tests/index.html into a browser instead of +# make jstest. .PHONY: test pytest jstest stylecheck jsstyle githook docs diff --git a/README.md b/README.md index b500205c6..b311ed99c 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Empress -[![Build Status](https://travis-ci.org/biocore/empress.svg?branch=master)](https://travis-ci.org/biocore/empress) +[![](https://github.com/biocore/empress/workflows/Empress%20CI/badge.svg)](https://github.com/biocore/empress/actions)