Skip to content

Commit

Permalink
add depcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
znarf committed Nov 22, 2023
1 parent 4fe2ebd commit 75a4467
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 1 deletion.
49 changes: 49 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
lint:
runs-on: ubuntu-latest

timeout-minutes: 15

steps:
- name: Update apt
run: sudo apt-get update || exit 0
Expand Down Expand Up @@ -58,6 +60,8 @@ jobs:
prettier:
runs-on: ubuntu-latest

timeout-minutes: 15

steps:
- name: Update apt
run: sudo apt-get update || exit 0
Expand Down Expand Up @@ -96,9 +100,54 @@ jobs:

- run: npm run prettier:check

depcheck:
runs-on: ubuntu-latest

timeout-minutes: 15

steps:
- name: Update apt
run: sudo apt-get update || exit 0

- name: Install graphicsmagick
run: sudo apt-get install -y graphicsmagick

- name: Checkout
uses: actions/checkout@v4

- name: Setup node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'

# Npm cache
- name: Restore .npm cache
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.os }}-npm-cache-${{ github.sha }}
restore-keys: |
- ${{ runner.os }}-npm-cache-${{ github.sha }}
- ${{ runner.os }}-npm-cache-
- name: Restore node_modules
uses: actions/cache@v3
id: node-modules
with:
path: node_modules
key: ${{ runner.os }}-node-modules-${{ hashFiles('package-lock.json') }}

- name: Install dependencies
if: steps.node-modules.outputs.cache-hit != 'true'
run: npm ci --prefer-offline --no-audit

- run: npm run depcheck

test:
runs-on: ubuntu-latest

timeout-minutes: 30

services:
redis:
image: redis
Expand Down
8 changes: 7 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@
"prettier:write": "npm run prettier -- --write",
"start": "node dist/server",
"test:server": "TZ=UTC ./scripts/run_test.sh",
"prepare": "husky install"
"prepare": "husky install",
"depcheck": "npx depcheck"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
Expand Down Expand Up @@ -98,5 +99,10 @@
"cacheDirectories": [
"node_modules"
],
"depcheck": {
"ignores": [
"jest"
]
},
"heroku-run-build-script": true
}

0 comments on commit 75a4467

Please sign in to comment.