forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathciCheck.js
69 lines (60 loc) · 2.23 KB
/
ciCheck.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
'use strict'
const CiVersionCheck = require('./CiVersionCheck');
const mongoVersionList = require('mongodb-version-list');
const allNodeVersions = require('all-node-versions');
async function check() {
// Run checks
await checkMongoDbVersions();
await checkNodeVersions();
}
/**
* Check the MongoDB versions used in test environments.
*/
async function checkMongoDbVersions() {
const releasedVersions = await new Promise((resolve, reject) => {
mongoVersionList(function(error, versions) {
if (error) {
reject(error);
}
resolve(versions);
});
});
await new CiVersionCheck({
packageName: 'MongoDB',
packageSupportUrl: 'https://www.mongodb.com/support-policy',
yamlFilePath: './.github/workflows/ci.yml',
ciEnvironmentsKeyPath: 'jobs.check-mongo.strategy.matrix.include',
ciVersionKey: 'MONGODB_VERSION',
releasedVersions,
latestComponent: CiVersionCheck.versionComponents.path,
ignoreReleasedVersions: [
'<3.6.0', // These versions have reached their MongoDB end-of-life support date
'~3.7.0', // This is a development release according to MongoDB support
'~4.1.0', // This is a development release according to MongoDB support
'~4.3.0', // This is a development release according to MongoDB support
'~4.7.0', // This is a development release according to MongoDB support
],
}).check();
}
/**
* Check the Nodejs versions used in test environments.
*/
async function checkNodeVersions() {
const allVersions = await allNodeVersions();
const releasedVersions = allVersions.versions;
await new CiVersionCheck({
packageName: 'Node.js',
packageSupportUrl: 'https://github.com/nodejs/node/blob/master/CHANGELOG.md',
yamlFilePath: './.github/workflows/ci.yml',
ciEnvironmentsKeyPath: 'jobs.check-mongo.strategy.matrix.include',
ciVersionKey: 'NODE_VERSION',
releasedVersions,
latestComponent: CiVersionCheck.versionComponents.minor,
ignoreReleasedVersions: [
'<12.0.0', // These versions have reached their end-of-life support date
'>=13.0.0 <14.0.0', // These versions have reached their end-of-life support date
'>=16.0.0', // This version has not been officially released yet
],
}).check();
}
check();