-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (37 loc) · 1.16 KB
/
main.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
name: Node.js CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 18.x
uses: actions/setup-node@v1
with:
node-version: 18.x
# Create the package in the pipeline because if a package-lock.json is included, it interferes with the
# DigitalOcean deploy and makes it more complex.
- name: Create package.json
run: |
echo '{
"name": "aphor",
"version": "1.0.0",
"description": "Randomly displays a single quote from a json collection",
"scripts": {
"test": "jest"
},
"devDependencies": {
"@babel/core": "^7.21.4",
"@babel/preset-env": "^7.21.4",
"babel-jest": "^29.5.0",
"jest-environment-jsdom": "^29.5.0",
"jest-fetch-mock": "^3.0.3",
"node-fetch": "^2.6.9"
}
}' > package.json
- name: Install dependencies
run: npm i --package-lock-only && npm ci
- name: Install Jest
run: npm install --save-dev jest
- name: Run tests
run: npm test