Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs
name: CI

on:
push:
branches: ['main']
pull_request:
branches: ['main']

jobs:
test:
runs-on: ubuntu-latest
env:
# @devvit/test pulls in redis-memory-server, which by default downloads
# and compiles Redis (plus modules) from source on install and on first
# test run. That source build is slow and unreliable in CI. Point it at
# the prebuilt redis-server we install below: this both skips the
# install-time compile and makes the tests use the system binary.
REDISMS_SYSTEM_BINARY: /usr/bin/redis-server
steps:
- name: Checkout
uses: actions/checkout@v7.0.0
- name: Install Node.js
uses: actions/setup-node@v6.4.0
with:
node-version: 22.20.0
- name: Install Redis
run: sudo apt-get update && sudo apt-get install -y redis-server
- name: Install Dependencies
run: npm install --no-fund
- parallel:
- name: Typecheck
run: npm run test:types
- name: Lint
run: npm run lint
- name: Unit Test
run: npm run test:unit
- name: Build
run: npm run build
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,18 @@
"type": "module",
"scripts": {
"build": "vite build",
"deploy": "npm run type-check && npm run lint && npm run test && devvit upload",
"deploy": "npm run test:types && npm run lint && npm run test:unit && devvit upload",
"dev": "devvit playtest",
"launch": "npm run deploy && devvit publish",
"lint": "eslint 'src/**/*.{ts,tsx}'",
"login": "devvit login",
"prettier": "prettier-package-json --write ./package.json && prettier --write .",
"test": "vitest run",
"type-check": "tsc --build"
"test": "npm run test:types && npm run lint && npm run test:unit && npm run build",
"test:types": "tsc --build",
"test:unit": "vitest run"
},
"engines": {
"node": ">=22.2.0"
"node": ">=22.12.0"
},
"dependencies": {
"@devvit/start": "0.13.10",
Expand Down Expand Up @@ -45,6 +46,7 @@
"eslint": "10.8.0",
"eslint-plugin-react-hooks": "7.1.1",
"eslint-plugin-react-refresh": "0.5.3",
"globals": "17.8.0",
"prettier": "3.9.6",
"prettier-package-json": "2.8.0",
"prettier-plugin-tailwindcss": "0.8.1",
Expand Down