Skip to content

chore: migrate to tsdown and upgrade packages #310

chore: migrate to tsdown and upgrade packages

chore: migrate to tsdown and upgrade packages #310

Workflow file for this run

name: CI
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
env:
NODE_VERSION: 24.10.0
PNPM_VERSION: 10.7.1
jobs:
testCodebase:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Use pnpm ${{ env.PNPM_VERSION }}
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install deps
run: pnpm install
- name: Check linting
run: pnpm lint
- name: Check typecheck
run: pnpm typecheck
testCli:
runs-on: ubuntu-latest
services:
postgres:
image: postgres
ports:
- 5432:5432
env:
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432'
DIRECT_DATABASE_URL: 'postgresql://postgres:postgres@localhost:5432'
AUTH_ORIGIN: http://localhost:3000/api/auth
AUTH_SECRET: test123
steps:
- uses: actions/checkout@v4
- name: Use pnpm ${{ env.PNPM_VERSION }}
uses: pnpm/action-setup@v4
with:
version: ${{ env.PNPM_VERSION }}
run_install: false
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: pnpm
- name: Install deps
run: pnpm install
- name: Run the CI with default options
run: pnpm dev:ci
# setup the database inside the generated app
- name: app:init the database
run: cd my-sidebase-app && npx prisma db push
# code should be 100% correct at the start
- name: app:check linting
run: cd my-sidebase-app && pnpm lint
- name: app:check typing
run: cd my-sidebase-app && npm exec nuxi prepare && pnpm run typecheck
# start dev-app, all of the following adapted from https://stackoverflow.com/a/60996259
- name: app:run in dev
run: "cd my-sidebase-app && timeout 30 npm run dev || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
# start prod-app
- name: app:run in prod
run: "cd my-sidebase-app && npm run build && timeout 30 npm run preview || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"
# start dev-app and curl from it
- name: app:test in prod
run: "cd my-sidebase-app && timeout 30 npm run dev & (sleep 20 && curl --fail localhost:3000) || ( [[ $? -eq 124 ]] && echo \"app started and did not exit within first 30 seconds, thats good\" )"