surprising a bureaucrat is not illegal #80
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |