Skip to content

Commit 54a61b7

Browse files
authored
GitHub actions (#7035)
* Trying to setup GitHub Actions * Try to fix the workflow steps * Fix NODE_VERSION * Fix services * Fix services 2 * Fix redis service, remove docker service * Missing npm install * Fix Use Node.js step name * Remove greenkeeper * I believe we do not need this command * Try to include postgres * Fix postgres script * Remove before install script * Fix postgres before script * Try to fix connection to postgres * Fix postgress port * Postgres host * Still trying to connect on postgres * Still trying to connect on postgres - localhost * Split postgres in a separate job * Add postgres healthcheck * Set postgres just like github example * Fix postgres scripts with new credentials * Still trying to fix postgres connection * Now it looks only the username is wrong * Passing postgres password in the right way * try to install postgis * New attempt to install postgis * Fix postgis image name * Try to output tests * We need to start mongo * Increase tests timeout * Fix flaky test * Add GitHub Actions badge * Badge as html * Fix badge link * Remove Travis * try to fix coverage * Fix flaky test * Improve ci workflow * Change the mongo default test version * Fix the job name in the if clause * Ubuntu18.0.4 * Downgrade to 4.0.21 * Fix cache keys: * Trying with mongo 4.0.4 * Rever os and mongo versions * remove latest node
1 parent da905a3 commit 54a61b7

File tree

6 files changed

+123
-123
lines changed

6 files changed

+123
-123
lines changed

.github/workflows/ci.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: ci
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- '**'
9+
env:
10+
COVERAGE_OPTION: ./node_modules/.bin/nyc
11+
NODE_VERSION: 10
12+
PARSE_SERVER_TEST_TIMEOUT: 20000
13+
jobs:
14+
check-mongo:
15+
strategy:
16+
matrix:
17+
include:
18+
- name: Mongo 4.0.4, ReplicaSet, WiredTiger
19+
MONGODB_VERSION: 4.0.4
20+
MONGODB_TOPOLOGY: replicaset
21+
MONGODB_STORAGE_ENGINE: wiredTiger
22+
NODE_VERSION: 10
23+
- name: Mongo 3.6.21
24+
MONGODB_VERSION: 3.6.21
25+
NODE_VERSION: 10
26+
- name: Redis Cache
27+
PARSE_SERVER_TEST_CACHE: redis
28+
NODE_VERSION: 10
29+
- name: Node 12.12.0
30+
NODE_VERSION: 12.12.0
31+
name: ${{ matrix.name }}
32+
timeout-minutes: 30
33+
runs-on: ubuntu-18.04
34+
services:
35+
redis:
36+
image: redis
37+
ports:
38+
- 6379:6379
39+
env:
40+
MONGODB_VERSION: ${{ matrix.MONGODB_VERSION }}
41+
MONGODB_TOPOLOGY: ${{ matrix.MONGODB_TOPOLOGY }}
42+
MONGODB_STORAGE_ENGINE: ${{ matrix.MONGODB_STORAGE_ENGINE }}
43+
PARSE_SERVER_TEST_CACHE: ${{ matrix.PARSE_SERVER_TEST_CACHE }}
44+
NODE_VERSION: ${{ matrix.NODE_VERSION }}
45+
steps:
46+
- uses: actions/checkout@v2
47+
- name: Use Node.js ${{ matrix.NODE_VERSION }}
48+
uses: actions/setup-node@v1
49+
with:
50+
node-version: ${{ matrix.NODE_VERSION }}
51+
- name: Cache Node.js modules
52+
uses: actions/cache@v2
53+
with:
54+
path: ~/.npm
55+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
56+
restore-keys: |
57+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
58+
- name: Install dependencies
59+
run: npm ci
60+
- if: ${{ matrix.name == 'Mongo 3.6.21' }}
61+
run: npm run lint
62+
- run: npm run pretest
63+
- run: npm run coverage
64+
env:
65+
CI: true
66+
- run: bash <(curl -s https://codecov.io/bash)
67+
check-postgres:
68+
name: Postgresql
69+
timeout-minutes: 30
70+
runs-on: ubuntu-18.04
71+
services:
72+
redis:
73+
image: redis
74+
ports:
75+
- 6379:6379
76+
postgres:
77+
image: postgis/postgis:11-3.0
78+
env:
79+
POSTGRES_PASSWORD: postgres
80+
ports:
81+
- 5432:5432
82+
options: >-
83+
--health-cmd pg_isready
84+
--health-interval 10s
85+
--health-timeout 5s
86+
--health-retries 5
87+
env:
88+
PARSE_SERVER_TEST_DB: postgres
89+
POSTGRES_MAJOR_VERSION: 11
90+
PARSE_SERVER_TEST_DATABASE_URI: postgres://postgres:postgres@localhost:5432/parse_server_postgres_adapter_test_database
91+
steps:
92+
- uses: actions/checkout@v2
93+
- name: Use Node.js 10
94+
uses: actions/setup-node@v1
95+
with:
96+
node-version: 10
97+
- name: Cache Node.js modules
98+
uses: actions/cache@v2
99+
with:
100+
path: ~/.npm
101+
key: ${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-${{ hashFiles('**/package-lock.json') }}
102+
restore-keys: |
103+
${{ runner.os }}-node-${{ matrix.NODE_VERSION }}-
104+
- name: Install dependencies
105+
run: npm ci
106+
- run: bash scripts/before_script_postgres.sh
107+
- run: npm run coverage
108+
env:
109+
CI: true
110+
- run: bash <(curl -s https://codecov.io/bash)

.travis.yml

Lines changed: 0 additions & 80 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010

1111
<p align="center">
1212
<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>
13-
<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>
13+
<a href="https://github.com/parse-community/parse-server/actions?query=workflow%3Aci+branch%3Amaster">
14+
<img alt="Build status" src="https://github.com/parse-community/parse-server/workflows/ci/badge.svg?branch=master">
15+
</a>
1416
<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>
1517
<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>
1618
<a href="https://community.parseplatform.org/"><img alt="Join the conversation" src="https://img.shields.io/discourse/https/community.parseplatform.org/topics.svg"></a>

scripts/before_install_postgres.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

scripts/before_script_postgres.sh

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ set -e
44

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

7-
node -e 'require("./lib/index.js")'
8-
greenkeeper-lockfile-update
9-
10-
psql -v ON_ERROR_STOP=1 -p 5433 --username "postgres" --dbname "${POSTGRES_DB}" <<-EOSQL
7+
PGPASSWORD=postgres psql -v ON_ERROR_STOP=1 -h localhost -U postgres <<-EOSQL
118
CREATE DATABASE parse_server_postgres_adapter_test_database;
129
\c parse_server_postgres_adapter_test_database;
1310
CREATE EXTENSION postgis;

spec/CloudCode.spec.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,9 +1633,8 @@ describe('Cloud Code', () => {
16331633

16341634
it('should set the message / success on the job', done => {
16351635
Parse.Cloud.job('myJob', req => {
1636-
req.message('hello');
16371636
const promise = req
1638-
.message()
1637+
.message('hello')
16391638
.then(() => {
16401639
return getJobStatus(req.jobId);
16411640
})
@@ -1716,9 +1715,15 @@ describe('Cloud Code', () => {
17161715
throw new Parse.Error(101, 'Something went wrong');
17171716
});
17181717
const job = await Parse.Cloud.startJob('myJobError');
1719-
const jobStatus = await Parse.Cloud.getJobStatus(job);
1718+
let jobStatus, status;
1719+
while (status !== 'failed') {
1720+
if (jobStatus) {
1721+
await new Promise(resolve => setTimeout(resolve, 10));
1722+
}
1723+
jobStatus = await Parse.Cloud.getJobStatus(job);
1724+
status = jobStatus.get('status');
1725+
}
17201726
expect(jobStatus.get('message')).toEqual('Something went wrong');
1721-
expect(jobStatus.get('status')).toEqual('failed');
17221727
});
17231728

17241729
function getJobStatus(jobId) {

0 commit comments

Comments
 (0)