-
Notifications
You must be signed in to change notification settings - Fork 4
136 lines (111 loc) · 3.82 KB
/
ci.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
name: Development CI
on:
push:
branches: [ dev, develop, development ]
pull_request:
branches: [ main, master, dev, develop, development ]
jobs:
unit-tests:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl3
- name: Install dependencies
run: |
npm install
npm install [email protected] --save-dev
- name: Run linter
run: npm run lint
- name: Run unit tests
run: npm run test:unit
env:
PARSE_MASTER_KEY: 'test-master-key'
PARSE_APP_ID: 'test-app-id'
MONGOMS_VERSION: "6.0.2"
MONGOMS_DOWNLOAD_URL: "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.2.tgz"
MONGOMS_SYSTEM_BINARY: "/usr/bin/mongod"
integration-tests:
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl3
- name: Install dependencies
run: npm ci
- name: Run integration tests
run: npm run test:integration
env:
PARSE_MASTER_KEY: 'test-master-key'
PARSE_APP_ID: 'test-app-id'
MONGOMS_VERSION: "6.0.2"
MONGOMS_DOWNLOAD_URL: "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.2.tgz"
MONGOMS_SYSTEM_BINARY: "/usr/bin/mongod"
main-tests:
runs-on: ubuntu-latest
needs: unit-tests
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libssl3
- name: Install dependencies
run: npm ci
- name: Run main tests
run: npm run test:main
env:
PARSE_MASTER_KEY: 'test-master-key'
PARSE_APP_ID: 'test-app-id'
MONGOMS_VERSION: "6.0.2"
MONGOMS_DOWNLOAD_URL: "https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-ubuntu2204-6.0.2.tgz"
MONGOMS_SYSTEM_BINARY: "/usr/bin/mongod"
build:
needs: [unit-tests, integration-tests, main-tests]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: '16.x'
- name: Install dependencies
run: npm ci
- name: Build package
run: npm pack
- name: Upload build artifact
uses: actions/upload-artifact@v3
with:
name: package
path: "*.tgz"
- name: Install MongoDB
run: |
wget -qO - https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu $(lsb_release -cs)/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org
- name: Start MongoDB
run: |
sudo systemctl start mongod
sleep 5 # Give MongoDB time to start