refactor: update import paths from .mts to .mjs and .ts to .js for co… #62
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: ci | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| jobs: | |
| ci: | |
| runs-on: ubuntu-latest | |
| services: | |
| postgres: | |
| image: postgres:16 | |
| env: | |
| POSTGRES_USER: postgres | |
| POSTGRES_PASSWORD: postgres | |
| POSTGRES_DB: cherry_test | |
| ports: | |
| - 5432:5432 | |
| options: >- | |
| --health-cmd="pg_isready -U postgres -d cherry_test" | |
| --health-interval=5s | |
| --health-timeout=5s | |
| --health-retries=20 | |
| env: | |
| DATABASE_URL: postgresql://postgres:postgres@localhost:5432/cherry_test?schema=public | |
| NODE_OPTIONS: "--conditions=development" | |
| PATH: "/usr/bin:/bin:/usr/local/bin" | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '22' | |
| cache: 'npm' | |
| - name: Install Postgres client | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y postgresql-client ripgrep | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Check clean working tree | |
| run: npm run check:clean | |
| - name: Wait for Postgres | |
| run: | | |
| ready=0 | |
| for i in {1..30}; do | |
| if pg_isready -h localhost -p 5432 -U postgres -d cherry_test; then | |
| echo "Postgres is ready" | |
| ready=1 | |
| break | |
| fi | |
| echo "Waiting for Postgres... ($i)" | |
| sleep 2 | |
| done | |
| if [ "$ready" -ne 1 ]; then | |
| echo "Postgres never became ready" | |
| exit 1 | |
| fi | |
| - name: Apply Prisma migrations to test DB | |
| run: | | |
| npx prisma generate --schema=prisma/schema.prisma | |
| npx prisma migrate deploy --schema=prisma/schema.prisma | |
| - name: Verify Prisma migration status | |
| run: npx prisma migrate status --schema=prisma/schema.prisma | |
| - name: Dump migration status on failure | |
| if: failure() | |
| run: | | |
| echo "DB: $DATABASE_URL" | sed -E 's#(//[^:/@]+):[^@]+@#\\1:***@#' | |
| npx prisma migrate status --schema=prisma/schema.prisma || true | |
| psql "$DATABASE_URL" -c "\\dt" || true | |
| - name: Test | |
| run: npm test | |
| - name: Build | |
| run: npm run build | |
| - name: Check (composite) | |
| run: npm run check |