Migrate CI to Github Actions (#1235)

This commit is contained in:
Xiaoji Chen 2020-11-25 15:05:24 -08:00 committed by GitHub
parent 2503013e42
commit 7f421737e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 74 additions and 23 deletions

33
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: test
# On every pull request, but only on push to master
on:
push:
branches:
- master
pull_request_target:
jobs:
test-node:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.1.1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Install dependencies
run: |
yarn bootstrap
- name: Run tests
run: |
yarn test ci
- name: Coveralls
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

41
.github/workflows/website.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: website
on:
push:
branches:
- '*-release'
jobs:
publish-website:
runs-on: ubuntu-latest
if: github.repository_owner == 'visgl'
env:
MapboxAccessToken: ${{ secrets.MAPBOX_ACCESS_TOKEN }}
steps:
- uses: actions/checkout@v2.1.1
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: Get version
id: get-version
run: LATEST=$(npm show react-map-gl version | grep -o -E "^[0-9]+\.[0-9]+") && echo "::set-output name=latest::/${LATEST}-release"
- name: Check version
if: ${{ !endsWith(github.ref, steps.get-version.outputs.latest) }}
run: |
echo "Website is only published from the latest release branch"
- name: Build & deploy website
if: ${{ endsWith(github.ref, steps.get-version.outputs.latest) }}
run: |
yarn bootstrap
cd website
yarn
yarn build
yarn deploy

View File

@ -1,23 +0,0 @@
language: node_js
os: linux
sudo: required
dist: trusty
addons:
apt:
packages:
- mesa-utils
- xvfb
- libgl1-mesa-dri
- libglapi-mesa
- libosmesa6
- libxi-dev
node_js:
- '10'
install:
- yarn bootstrap
before_script:
- export DISPLAY=:99.0; sh -e /etc/init.d/xvfb start
script:
- npm run test ci
after_success:
- cat coverage/lcov.info | coveralls