Switch from travis to github actions.
ADD
.github/workflows/main.yml
+name: Build and test
+
+on:
+ push:
+ # branches:
+ # - master
+ pull_request:
+ branches:
+ - master
+ release:
+ types:
+ - created
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v2
+ with:
+ node-version: 15.x
+ - uses: browser-actions/setup-firefox@latest
+ - run: sudo apt-get install --yes --no-install-recommends cpio optipng
+ - run: sudo apt-get remove --yes fonts-lato
+ - run: fc-list
+ - run: firefox --version
+ - run: google-chrome --version
+ - run: npm install
+ - run: npm run setup-website
+ - run: npm run ci-xvfb
+ - run: npm run ci-build-website
+
+ - name: Report coverage
+ run: |
+ pip3 install codecov
+ codecov
+
+ - name: On failure, create alternate baseline images in case the new behavior is correct
+ if: ${{ failure() }}
+ run: |
+ pip3 install girder_client
+ python3 tests/runners/baseline_images.py -cevb _build
+ - name: Upload test images on failure
+ if: ${{ failure() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: images
+ path: |
+ _build/images
+ _build/Baseline*tgz
+ - name: Upload artifacts
+ if: ${{ always() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: dist
+ path: |
+ dist/apidocs
+ dist/built
+ - name: Upload built website
+ if: ${{ success() }}
+ uses: actions/upload-artifact@v2
+ with:
+ name: website
+ path: |
+ website/public
+ deploy-website:
+ if: ${{ github.ref == 'refs/heads/master' }}
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Import artifacts
+ uses: actions/download-artifact@v2
+ with:
+ name: website
+ path: website/public
+ - name: Deploy
+ uses: peaceiris/actions-gh-pages@v3
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ publish_dir: website/public
+ force_orphan: true
+ deploy-releases:
+ if: ${{ startswith(github.ref, 'refs/tags/') }}
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - name: Import artifacts
+ uses: actions/download-artifact@v2
+ with:
+ name: dist
+ path: dist
+ - name: Create Release
+ uses: softprops/action-gh-release@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ # name: "Version ${{ github.ref }}"
+ draft: false
+ prerelease: false
+ files: |
+ dist/built/geo.js
+ dist/built/geo.min.js
+ dist/built/geo.lean.js
+ dist/built/geo.lean.min.js
+ deploy-npm:
+ if: ${{ startswith(github.ref, 'refs/tags/') }}
+ needs: build
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/checkout@v2
+ - uses: actions/setup-node@v2
+ with:
+ node-version: 15.x
+ - name: Import artifacts
+ uses: actions/download-artifact@v2
+ with:
+ name: dist
+ path: dist
+ - uses: JS-DevTools/npm-publish@v1
+ with:
+ token: ${{ secrets.NPM_TOKEN }}
+ dry-run: true

DELETE
.travis.yml
-language: node_js
-# At this time, the travis trusty sudo environment works, but the sudo: false
-# environment doesn't (it might with a bunch of apt packages).
-sudo: required
-dist: xenial
-
-node_js:
- - 12
-
-addons:
- # version 55.0 - 57.x have an issue with screenshots.
- # version 67.0 has an issue with touch events.
- # firefox: 66.0.5
- firefox: latest
- # We can change to a specific version of Chrome later. Versions 68 - 70 have
- # an issue with webgl fallback rendering.
- chrome: stable
- apt:
- packages:
- - optipng
-
-cache:
- directories:
- - node_modules
- - "$HOME/cache"
- - "$TRAVIS_BUILD_DIR/dist/data"
-
-before_install:
- # Start xvfb with a specific resolution and pixel depth
- - "/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :99 -ac -screen 0 1280x1024x24"
- - npm install -g npm@latest
- # Prune the npm packages. If this fails for any reason, just remove them all
- - npm prune || rm -r node_modules
- # Get a specific version of Chrome.
- # - CHROME_VERSION=67.0.3396.79
- # - if ! [ -f "${HOME}/cache/chrome64_${CHROME_VERSION}.deb" ]; then curl -L "https://www.slimjet.com/chrome/download-chrome.php?file=lnx%2Fchrome64_${CHROME_VERSION}.deb" -o "${HOME}/cache/chrome64_${CHROME_VERSION}.deb"; fi
- # - sudo dpkg -i "${HOME}/cache/chrome64_${CHROME_VERSION}.deb"
- - google-chrome --version
-
-install:
- - npm install
- - npm list || true
- # Install for the website build
- - npm run setup-website
-
-before_script:
- - export DISPLAY=:99.0
-
-script:
- - npm run ci
- # Build the website to ensure that it will pass
- - npm run ci-build-website
-
-after_failure:
- # Upload test results. First make them smaller with optipng.
- - pip install --user --upgrade 'girder-client<3.1' requests[security] pyOpenSSL six
- - find images -name '*-test.png' -exec optipng {} \+ || true
- - find images -name '*-test.png' -exec python scripts/upload_travis_results.py {} \+ || true
- # Upload build artifacts
- - find dist/built -type f -exec python scripts/upload_travis_results.py {} \+ || true
- # Generate a new set of baseline images, in case we decide the new results
- # are now correct
- - rm -r dist/data/base-images 2>/dev/null >/dev/null || true
- - python tests/runners/baseline_images.py -cgvb images
- - find images -name 'Baseline Images*.tgz' -exec python scripts/upload_travis_results.py {} \+ || true
-
-after_success:
- # - find dist \( -name '*coverage*xml' -o -name 'lcov.info' \) -exec ls -al {} \+ || true
- # - npm run codecov
- - bash <(curl -s https://codecov.io/bash)
- # Upload build artifacts
- - pip install --user --upgrade 'girder-client<3.1' requests[security] pyOpenSSL six
- - find dist/built -type f -exec python scripts/upload_travis_results.py {} \+
-
-deploy:
- - provider: pages
- local-dir: website/public
- github-token: $GITHUB_TOKEN
- skip-cleanup: true
- on:
- branch: master
- - provider: releases
- api_key: $GITHUB_TOKEN
- file:
- - dist/built/geo.js
- - dist/built/geo.min.js
- - dist/built/geo.lean.js
- - dist/built/geo.lean.min.js
- skip-cleanup: true
- on:
- tags: true
- # We could emit artifacts on all branches rather than just master
- branch: master
- # all_branches: true
- - provider: npm
- api_key: $NPM_TOKEN
- email: david.manthey@kitware.com
- skip-cleanup: true
- script: "npm publish"
- on:
- tags: true

MODIFY
README.md
README.md
![GeoJS](https://opengeoscience.github.io/geojs/images/logo_256.png)
-[![Build Status](https://travis-ci.com/OpenGeoscience/geojs.svg?branch=master)](https://travis-ci.com/OpenGeoscience/geojs)
+[![Build Status](https://github.com/opengeoscience/geojs/actions/workflows/main.yml/badge.svg)](https://github.com/opengeoscience/geojs/actions)
[![codecov.io](https://codecov.io/github/OpenGeoscience/geojs/coverage.svg?branch=master)](https://codecov.io/github/OpenGeoscience/geojs?branch=master)
[![DOI](https://img.shields.io/badge/DOI-10.5281%2Fzenodo.15459-blue)](https://dx.doi.org/10.5281/zenodo.15459)
[![Gitter](https://badges.gitter.im/OpenGeoscience/geojs.svg)](https://gitter.im/OpenGeoscience/geojs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)

MODIFY
docs/developers.rst
docs/developers.rst
@@ -112,4 +112,4 @@ To make a new GeoJS release:
- Tag the commit on GitHub with a tag of the form vX.Y.Z (e.g., v0.17.0).
- After the release appears on GitHub, update the release notes with the changes since the last release.
-Tagging a commit on the master branch will trigger a build on travis-ci.com, at the end of which the new version will be published to npm and the build artifacts will be pushed to the tagged version on GitHub.
+Tagging a commit on the master branch will trigger a build on CI, at the end of which the new version will be published to npm and the build artifacts will be pushed to the tagged version on GitHub.

DELETE
scripts/upload_travis_results.py
-from __future__ import print_function
-import girder_client
-import os
-import six
-import sys
-
-
-def main():
- # Use the API key to authenticate.
- key = os.environ.get('GIRDER_API_KEY')
- if key is None:
- print('Environment variable GIRDER_API_KEY is blank. Cannot upload files.', file=sys.stderr)
- return 1
-
- gc = girder_client.GirderClient(host='data.kitware.com', scheme='https')
- # The api key needs scopes of at least
- # ["core.data.write","core.data.read","core.user_info.read"]
- gc.authenticate(apiKey=key)
-
- # Retrieve the target folder, which should be at ~/Public/Travis\ GeoJS
- user = gc.get('user/me')
- if user is None:
- print('No user logged in; API key may be bad.', file=sys.stderr)
- return 1
- folder = gc.get('resource/lookup', parameters={'path': 'collection/GeoJS/Public'})
-
- folder = gc.loadOrCreateFolder('Travis GeoJS', folder['_id'], 'folder')
-
- travis_build_number = os.environ.get('TRAVIS_BUILD_NUMBER')
- folderName = travis_build_number
- if os.environ.get('TRAVIS_EVENT_TYPE') == 'pull_request':
- folderName += ' PR #%s %s' % (
- os.environ.get('TRAVIS_PULL_REQUEST'), os.environ.get('TRAVIS_PULL_REQUEST_BRANCH'))
- elif os.environ.get('TRAVIS_BRANCH'):
- folderName += ' ' + os.environ.get('TRAVIS_BRANCH')
- # folder = gc.loadOrCreateFolder(folderName, folder['_id'], 'folder')
- try:
- folder = six.next(gc.listFolder(folder['_id'], 'folder', name=folderName))
- except StopIteration:
- folder = gc.createFolder(
- folder['_id'], folderName, os.environ.get('TRAVIS_COMMIT_MESSAGE', ''))
-
- # If we have a build matrix, this could be of use
- # travis_job_number = os.environ.get('TRAVIS_JOB_NUMBER')
- # folder = gc.loadOrCreateFolder(travis_job_number, folder['_id'], 'folder')
-
- # Upload the files specified on the command line, creating an item for each
- for fileName in sys.argv[1:]:
- (dirname, filename) = os.path.split(fileName)
- size = os.stat(fileName).st_size
- print(dirname, filename)
- with open(fileName, 'rb') as fd:
- gc.uploadFile(
- parentId=folder['_id'], stream=fd, name=filename, size=size,
- parentType='folder')
- print('uploaded')
-
-
-if __name__ == '__main__':
- sys.exit(main())

Switch from travis to github actions.