From 77e278578f160ebeacac94d5509bc71c0198375a Mon Sep 17 00:00:00 2001 From: "danil.radkovskyi" Date: Fri, 31 Jul 2026 16:58:43 +0200 Subject: [PATCH 1/2] Add CI workflow config Add .github/workflows/ci.yaml matching the bare template (with node-version 22.20.0, since this template uses vite 8 / rolldown which require node >=22.12.0). package.json: wire up the scripts the workflow expects. This template already uses vitest, so test:unit runs 'vitest run'; add test:types, make the aggregate test script match bare, remove the duplicate type-check script, and point deploy at the test:* scripts. Bump engines.node to >=22.12.0 to match vite's requirement. Also add the missing 'globals' devDependency: eslint.config.js imports it but it was not declared, so lint failed on a clean install. Built with Snoocode --- .github/workflows/ci.yaml | 30 ++++++++++++++++++++++++++++++ package.json | 10 ++++++---- 2 files changed, 36 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..10e7193 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,30 @@ +# 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 + 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 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 diff --git a/package.json b/package.json index 1eec728..dfad270 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", From d48b339bcda45427afd51cfa3060c23ecc207a03 Mon Sep 17 00:00:00 2001 From: "danil.radkovskyi" Date: Mon, 3 Aug 2026 12:49:43 +0200 Subject: [PATCH 2/2] Use prebuilt redis in CI to stabilize install @devvit/test depends on redis-memory-server, whose postinstall downloads and compiles Redis and its modules from source. That source build is slow and fails intermittently on ubuntu CI (RedisJSON/RedisTimeSeries), which broke the Install Dependencies step. Install redis-server from apt and set REDISMS_SYSTEM_BINARY to it. This skips the install-time source compile entirely and makes the unit tests run against the prebuilt binary. Built with Snoocode --- .github/workflows/ci.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 10e7193..c3e5729 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -10,6 +10,13 @@ on: 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 @@ -17,6 +24,8 @@ jobs: 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: