Skip to content

Github Actions #1267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Dec 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- '**'
jobs:
build:
runs-on: ubuntu-18.04
timeout-minutes: 30
env:
MONGODB_VERSION: 3.6.9
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.14'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- run: npm ci
- run: npm install -g mongodb-runner
- run: mongodb-runner start
- run: npm run lint
- run: npm test -- --maxWorkers=4
- run: npm run integration
env:
CI: true
- run: bash <(curl -s https://codecov.io/bash)
47 changes: 47 additions & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: docs
on:
push:
branches:
- master
tags:
- '*'
jobs:
build:
runs-on: ubuntu-18.04
timeout-minutes: 30
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '10.14'
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Get Tag
uses: actions/github-script@v3
id: tag
with:
github-token: ${{secrets.GITHUB_TOKEN}}
result-encoding: string
script: |
const ref = process.env.GITHUB_REF
if(!ref.startsWith('refs/tags/'))
return ''
return ref.replace(/^refs\/tags\//, '')
- name: Generate Docs
run: |
echo $SOURCE_TAG
npm ci
npm run release_docs
env:
SOURCE_TAG: ${{ steps.tag.outputs.result }}
- name: Deploy
uses: peaceiris/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<a href="https://twitter.com/intent/follow?screen_name=parseplatform"><img alt="Follow on Twitter" src="https://img.shields.io/twitter/follow/parseplatform?style=social&label=Follow"></a>
<a href="https://community.parseplatform.org/"><img alt="Join the conversation" src="https://img.shields.io/discourse/https/community.parseplatform.org/topics.svg"></a>
<a href="https://github.com/parse-community/Parse-SDK-JS/blob/master/LICENSE"><img alt="License" src="https://img.shields.io/badge/license-BSD-lightgrey.svg"></a>
<a href=" https://travis-ci.org/parse-community/Parse-SDK-JS"><img alt="Build status" src="https://travis-ci.org/parse-community/Parse-SDK-JS.svg?branch=master"></a>
<a href="https://github.com/parse-community/Parse-SDK-JS/actions?query=workflow%3Aci+branch%3Amaster"><img alt="Build status" src="https://github.com/parse-community/Parse-SDK-JS/workflows/ci/badge.svg?branch=master"></a>
<a href="#backers"><img alt="Backers on Open Collective" src="https://opencollective.com/parse-server/backers/badge.svg" /></a>
<a href="#sponsors"><img alt="Sponsors on Open Collective" src="https://opencollective.com/parse-server/sponsors/badge.svg" /></a>
</p>
Expand Down
10 changes: 5 additions & 5 deletions release_docs.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/bin/sh -e
set -x
if [ "${TRAVIS_REPO_SLUG}" = "" ];
if [ "${GITHUB_ACTIONS}" = "" ];
then
echo "Cannot release docs without TRAVIS_REPO_SLUG set"
echo "Cannot release docs without GITHUB_ACTIONS set"
exit 0;
fi
REPO="https://github.com/${TRAVIS_REPO_SLUG}"
REPO="https://github.com/parse-community/Parse-SDK-JS"

rm -rf docs
git clone -b gh-pages --single-branch $REPO ./docs
Expand All @@ -15,9 +15,9 @@ cd ..

DEST="master"

if [ "${TRAVIS_TAG}" != "" ];
if [ "${SOURCE_TAG}" != "" ];
then
DEST="${TRAVIS_TAG}"
DEST="${SOURCE_TAG}"
# change the default page to the latest
echo "<meta http-equiv='refresh' content='0; url=/Parse-SDK-JS/api/${DEST}'>" > "docs/api/index.html"
fi
Expand Down