diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 000000000..b4dc83967 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml new file mode 100644 index 000000000..b9449a4d8 --- /dev/null +++ b/.github/workflows/pages.yml @@ -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/actions-gh-pages@v3.7.3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./docs diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4ff1df130..000000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: node_js -dist: trusty -node_js: -- '10.14' -branches: - only: - - master - - "/^greenkeeper/.*$/" - - "/^v?[0-9]+.[0-9]+.[0-9]+(-.*)?$/" -cache: - directories: - - "$HOME/.npm" - - "$HOME/.mongodb/versions" -jobs: - include: - - stage: test - env: - - MONGODB_VERSION=3.6.9 - before_script: - - npm install -g mongodb-runner - - mongodb-runner start - script: - - npm run lint - - npm test -- --maxWorkers=4 - - npm run integration - after_script: "./node_modules/codecov/bin/codecov -f ./coverage/coverage-final.json - && rm -rf ./coverage" - - stage: release - env: - - - before_script: skip - after_script: skip - script: - - npm run release_docs - deploy: - - provider: pages - skip_cleanup: true - github_token: "$GITHUB_TOKEN" - local_dir: docs/ - on: - all_branches: true - - provider: npm - skip_cleanup: true - email: - secure: NGcEiR5Q9N2n83xRUTY9KjrirwE86/8CiLxfdheKVYGag454GXh8uPHZQzhv9p4taprx/nPxQtnyLdUOrlmbW9a5grA1j/QMxKmKw00AjkIMefOSCJ4n0penlz2JI7M746DPraUwiJ2/UZERwV5cQmJg4X3eNetEc68WmLQeeV1IV6/72vExA0zFWdb+eg6sP06ZyYLi9StO730LqnxPsvqQSRJbFn7RVgj8Jz9aRK2YnMT8pq6Vj7N56Pu9nnno4eytfNynlzNgubBHhF1Jl5dxW3VWoem5/B7ehxk2sgZgkgH53kFmZsePTu2gFwQHGVV/zl40/a2BDjsIm4Na0X52HEoPMEHUlemRVMXB3Sl9sglo72YpGAbIc3rYRsr23aJ2pUgXVGjuhdQqB9OH/UMWPmm9ZTtQg08nhBfOQDLvf7rHrScqPGk6pWJEMAXA4B09asFD1wcrMfdgs8uuPJ2DIzxSK4FMyfbJci5/G/BzojtQsOn/PGdLZ5HM7gHwUoZ8qYbv+sVtNl4vOXEAuyuOpm9i8OJZBG+BzVwAoXZeilJtHlt4LkZBhSKcLfWg+2V1t+VmOr4cnBHPLHOdSYTkI9zqyRgKDI3zbSszLQcuNVXDAsygI5/MbW+xEYiY8lllvfj3KTdXrTobJGL97A6egq9ZxtY6EOGbbMgUmkg= - api_key: - secure: dEvG8zO1GL6yEJkfcbpIE+PejmsKPgZsOY4xGxFtrCdDCk4qHTyO6qc9TwQ5m+LfajZuq9EGCyTj7mPcwOrwmLTmX+sEP8QcW6L08syUvQeXqSL28RM10e6i/aEeMzwLrEvh9MmJZhA1mvuQLGq8Sx6SPZHQaQvvOia2hwQaATI9EM+FO1+ieawSIctNvtqkWwvqHHYTDJcJvT8q5uxIf2b5vJj42j2+JLuMDxVKwc7khdO/k9JBpbd0YZptIL3SL4LfMIczKMH/bMwAarG/Cm6fggexPCyofJn7Oof9PBXgUMDUCgxYvHstLK1WbvbEeyA6DvJIoY3SYwmdEjjIUdasMLTJyHlpppntR8fMmEt71BpHJG2TcLOt/dk1BdAKdNOLZMODo/nhLNuxvC3ymB8N2ZfhFk8cGEfU2SdapRkA9RVYEt6mrXT0lJEJ2V/A1giRNzeYaUX69JzcnUACJlzmbxlyRESvawdWJI+/JzjROS0PJG8y9cpe8I+SwqbNi7NFk1lWnSmvcyjTM4fFMppPdz3rEaGBYY7S1NlMayG5PdCctxn6ZBC6snRDMEPL2W2FbOO275M+fiwJ9m5A6AWapeBADAzc7gRCobpXB2dQXrvFi+2X6ReHP09ecFzdJLVEt9VdPAPUij/0s9Mby219s731mFh/0zhdYAo8/fA= - on: - tags: true - all_branches: true - repo: parse-community/Parse-SDK-JS diff --git a/README.md b/README.md index c3b30dac8..88e2e8419 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Follow on Twitter Join the conversation License - Build status + Build status Backers on Open Collective Sponsors on Open Collective

diff --git a/release_docs.sh b/release_docs.sh index 5c7b4c127..093619783 100755 --- a/release_docs.sh +++ b/release_docs.sh @@ -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 @@ -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 "" > "docs/api/index.html" fi