Skip to content

Commit

Permalink
feat: add CI typecheck job
Browse files Browse the repository at this point in the history
  • Loading branch information
kewitz committed Oct 3, 2024
1 parent 14f9a60 commit f7e0214
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 7 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,32 @@ jobs:

- run: npm run lint:quiet

typescript:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4

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

- name: Restore node_modules
uses: actions/cache@v4
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 type:check

prettier:
runs-on: ubuntu-latest

Expand Down
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,30 +38,31 @@
"winston": "3.13.0"
},
"scripts": {
"build": "npm run build:clean && npm run build:updates && npm run build:server",
"build:clean": "rm -rf dist && mkdir dist",
"build:server": "babel ./src --copy-files --extensions .js,.ts -d ./dist",
"build:updates": "npm --prefix node_modules/cloudflare-ip run update-list",
"build": "npm run build:clean && npm run build:updates && npm run build:server",
"commit": "git-cz",
"depcheck": "npx @opencollective/depcheck .",
"deploy:production": "./scripts/pre-deploy.sh production && git push production main",
"deploy:staging": "./scripts/pre-deploy.sh staging && git push -f staging main",
"dev": "nodemon src/server/index.js -x \"babel-node --extensions .js,.ts\" . -e js,ts",
"git:clean": "./scripts/git_clean.sh",
"graphql:update": "npm-run-all graphql:updateV1 graphql:updateV2",
"graphql:update:local": "cp ../frontend/lib/graphql/*.graphql src/graphql/ && prettier src/graphql/*.graphql --write",
"graphql:update": "npm-run-all graphql:updateV1 graphql:updateV2",
"graphql:updateV1": "curl https://raw.githubusercontent.com/opencollective/opencollective-frontend/main/lib/graphql/schema.graphql --output src/graphql/schema.graphql && prettier src/graphql/schema.graphql --write",
"graphql:updateV2": "curl https://raw.githubusercontent.com/opencollective/opencollective-frontend/main/lib/graphql/schemaV2.graphql --output src/graphql/schemaV2.graphql && prettier src/graphql/schemaV2.graphql --write",
"lint": "eslint . --ext='js,ts,graphql'",
"lint-staged": "lint-staged",
"lint:fix": "npm run lint -- --fix",
"lint:quiet": "npm run lint -- --quiet",
"prettier": "prettier \"**/*.@(js|ts|json|md)\" --ignore-path .eslintignore",
"lint": "eslint . --ext='js,ts,graphql'",
"prepare": "husky",
"prettier:check": "npm run prettier -- --list-different",
"prettier:write": "npm run prettier -- --write",
"prettier": "prettier \"**/*.@(js|ts|json|md)\" --ignore-path .eslintignore",
"start": "node dist/server",
"test:server": "TZ=UTC ./scripts/run_test.sh",
"prepare": "husky",
"lint-staged": "lint-staged",
"depcheck": "npx @opencollective/depcheck ."
"type:check": "tsc"
},
"devDependencies": {
"@babel/cli": "^7.23.4",
Expand Down

0 comments on commit f7e0214

Please sign in to comment.