Skip to content

GitHub actions #7035

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 48 commits into from
Dec 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
88a2b0e
Trying to setup GitHub Actions
davimacedo Dec 1, 2020
dbca985
Try to fix the workflow steps
davimacedo Dec 1, 2020
b4d20ca
Fix NODE_VERSION
davimacedo Dec 1, 2020
96c55d7
Fix services
davimacedo Dec 1, 2020
84d9f9b
Fix services 2
davimacedo Dec 1, 2020
09e13c3
Fix redis service, remove docker service
davimacedo Dec 1, 2020
560e358
Missing npm install
davimacedo Dec 1, 2020
c6c48c4
Fix Use Node.js step name
davimacedo Dec 1, 2020
84b8afa
Remove greenkeeper
davimacedo Dec 1, 2020
a4745c8
I believe we do not need this command
davimacedo Dec 1, 2020
282443e
Try to include postgres
davimacedo Dec 1, 2020
560fc8e
Fix postgres script
davimacedo Dec 1, 2020
5b06bff
Remove before install script
davimacedo Dec 1, 2020
eb92553
Fix postgres before script
davimacedo Dec 1, 2020
e193496
Try to fix connection to postgres
davimacedo Dec 1, 2020
dafa558
Fix postgress port
davimacedo Dec 1, 2020
65b3368
Postgres host
davimacedo Dec 1, 2020
58c3a69
Still trying to connect on postgres
davimacedo Dec 1, 2020
41be942
Still trying to connect on postgres - localhost
davimacedo Dec 1, 2020
43331dc
Split postgres in a separate job
davimacedo Dec 1, 2020
c322d68
Add postgres healthcheck
davimacedo Dec 2, 2020
4883548
Set postgres just like github example
davimacedo Dec 2, 2020
82fdc69
Fix postgres scripts with new credentials
davimacedo Dec 2, 2020
884fdfd
Still trying to fix postgres connection
davimacedo Dec 2, 2020
13bc38b
Now it looks only the username is wrong
davimacedo Dec 2, 2020
702a4e1
Passing postgres password in the right way
davimacedo Dec 2, 2020
9311927
try to install postgis
davimacedo Dec 2, 2020
8c283f0
New attempt to install postgis
davimacedo Dec 2, 2020
aed0ad0
Fix postgis image name
davimacedo Dec 2, 2020
19d1cd0
Try to output tests
davimacedo Dec 2, 2020
b2f4714
We need to start mongo
davimacedo Dec 2, 2020
7bf4bbd
Increase tests timeout
davimacedo Dec 2, 2020
7679739
Fix flaky test
davimacedo Dec 2, 2020
1e40452
Add GitHub Actions badge
davimacedo Dec 2, 2020
5a57339
Badge as html
davimacedo Dec 2, 2020
48fa133
Fix badge link
davimacedo Dec 2, 2020
6b9d14e
Remove Travis
davimacedo Dec 2, 2020
4966299
try to fix coverage
davimacedo Dec 2, 2020
32654cf
Fix flaky test
davimacedo Dec 2, 2020
7cc580a
Improve ci workflow
davimacedo Dec 3, 2020
eab6940
Change the mongo default test version
davimacedo Dec 3, 2020
88b0c0b
Fix the job name in the if clause
davimacedo Dec 3, 2020
dd53117
Ubuntu18.0.4
davimacedo Dec 3, 2020
ac0d66c
Downgrade to 4.0.21
davimacedo Dec 3, 2020
70c7cb4
Fix cache keys:
davimacedo Dec 3, 2020
f7a9e72
Trying with mongo 4.0.4
davimacedo Dec 3, 2020
289cd44
Rever os and mongo versions
davimacedo Dec 3, 2020
b8dfcb9
remove latest node
davimacedo Dec 3, 2020
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
110 changes: 110 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: ci
on:
push:
branches:
- master
pull_request:
branches:
- '**'
env:
COVERAGE_OPTION: ./node_modules/.bin/nyc
Copy link
Member

@mtrezza mtrezza Apr 5, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@davimacedo just wondering, what is COVERAGE_OPTION used for? I haven't found any references.

Edit: Found a ref, I think that can be removed, maybe from travis ci?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe it makes this to work.

Copy link
Member

@mtrezza mtrezza Apr 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How so?

I believe it was part of a script in package.json, that has been removed:

cross-env NODE_ENV=test TESTING=1 ./node_modules/.bin/babel-node $COVERAGE_OPTION ./node_modules/jasmine/bin/jasmine.js

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You might be right. Let's try to remove it and see what happens.

NODE_VERSION: 10
PARSE_SERVER_TEST_TIMEOUT: 20000
jobs:
check-mongo:
strategy:
matrix:
include:
- name: Mongo 4.0.4, ReplicaSet, WiredTiger
MONGODB_VERSION: 4.0.4
MONGODB_TOPOLOGY: replicaset
MONGODB_STORAGE_ENGINE: wiredTiger
NODE_VERSION: 10
- name: Mongo 3.6.21
MONGODB_VERSION: 3.6.21
NODE_VERSION: 10
- name: Redis Cache
PARSE_SERVER_TEST_CACHE: redis
NODE_VERSION: 10
- name: Node 12.12.0
NODE_VERSION: 12.12.0
name: ${{ matrix.name }}
timeout-minutes: 30
runs-on: ubuntu-18.04
services:
redis:
image: redis
ports:
- 6379:6379
env:
MONGODB_VERSION: ${{ matrix.MONGODB_VERSION }}
MONGODB_TOPOLOGY: ${{ matrix.MONGODB_TOPOLOGY }}
MONGODB_STORAGE_ENGINE: ${{ matrix.MONGODB_STORAGE_ENGINE }}
PARSE_SERVER_TEST_CACHE: ${{ matrix.PARSE_SERVER_TEST_CACHE }}
NODE_VERSION: ${{ matrix.NODE_VERSION }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.NODE_VERSION }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.NODE_VERSION }}
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
- if: ${{ matrix.name == 'Mongo 3.6.21' }}
run: npm run lint
- run: npm run pretest
- run: npm run coverage
env:
CI: true
- run: bash <(curl -s https://codecov.io/bash)
check-postgres:
name: Postgresql
timeout-minutes: 30
runs-on: ubuntu-18.04
services:
redis:
image: redis
ports:
- 6379:6379
postgres:
image: postgis/postgis:11-3.0
env:
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
PARSE_SERVER_TEST_DB: postgres
POSTGRES_MAJOR_VERSION: 11
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database
steps:
- uses: actions/checkout@v2
- name: Use Node.js 10
uses: actions/setup-node@v1
with:
node-version: 10
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
- name: Install dependencies
run: npm ci
- run: bash scripts/before_script_postgres.sh
- run: npm run coverage
env:
CI: true
- run: bash <(curl -s https://codecov.io/bash)
80 changes: 0 additions & 80 deletions .travis.yml

This file was deleted.

4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

<p align="center">
<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://travis-ci.org/parse-community/parse-server"><img alt="Build status" src="https://img.shields.io/travis/parse-community/parse-server/master.svg?style=flat"></a>
<a href="https://github.com/parse-community/parse-server/actions?query=workflow%3Aci+branch%3Amaster">
<img alt="Build status" src="https://github.com/parse-community/parse-server/workflows/ci/badge.svg?branch=master">
</a>
<a href="https://codecov.io/github/parse-community/parse-server?branch=master"><img alt="Coverage status" src="https://img.shields.io/codecov/c/github/parse-community/parse-server/master.svg"></a>
<a href="https://www.npmjs.com/package/parse-server"><img alt="npm version" src="https://img.shields.io/npm/v/parse-server.svg?style=flat"></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>
Expand Down
34 changes: 0 additions & 34 deletions scripts/before_install_postgres.sh

This file was deleted.

5 changes: 1 addition & 4 deletions scripts/before_script_postgres.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ set -e

echo "[SCRIPT] Before Script :: Setup Parse DB for Postgres ${POSTGRES_MAJOR_VERSION}"

node -e 'require("./lib/index.js")'
greenkeeper-lockfile-update

psql -v ON_ERROR_STOP=1 -p 5433 --username "postgres" --dbname "${POSTGRES_DB}" <<-EOSQL
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
CREATE DATABASE parse_server_postgres_adapter_test_database;
\c parse_server_postgres_adapter_test_database;
CREATE EXTENSION postgis;
Expand Down
13 changes: 9 additions & 4 deletions spec/CloudCode.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -1633,9 +1633,8 @@ describe('Cloud Code', () => {

it('should set the message / success on the job', done => {
Parse.Cloud.job('myJob', req => {
req.message('hello');
const promise = req
.message()
.message('hello')
.then(() => {
return getJobStatus(req.jobId);
})
Expand Down Expand Up @@ -1716,9 +1715,15 @@ describe('Cloud Code', () => {
throw new Parse.Error(101, 'Something went wrong');
});
const job = await Parse.Cloud.startJob('myJobError');
const jobStatus = await Parse.Cloud.getJobStatus(job);
let jobStatus, status;
while (status !== 'failed') {
if (jobStatus) {
await new Promise(resolve => setTimeout(resolve, 10));
}
jobStatus = await Parse.Cloud.getJobStatus(job);
status = jobStatus.get('status');
}
expect(jobStatus.get('message')).toEqual('Something went wrong');
expect(jobStatus.get('status')).toEqual('failed');
});

function getJobStatus(jobId) {
Expand Down