Skip to content

Merge pull request #28 from gylove1994/dependabot/npm_and_yarn/cache-… #66

Merge pull request #28 from gylove1994/dependabot/npm_and_yarn/cache-…

Merge pull request #28 from gylove1994/dependabot/npm_and_yarn/cache-… #66

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
env:
DATABASE_URL: postgres://testuser:testpassword@localhost:5432/testdb
jobs:
build:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: testdb
POSTGRES_USER: testuser
POSTGRES_PASSWORD: testpassword
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '20' # 根据你的项目需求选择合适的 Node.js 版本
- name: Install pnpm
run: npm install -g pnpm
- name: Cache pnpm modules
uses: actions/cache@v2
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-
- name: Install dependencies
run: pnpm install
- name: prisma migrate deploy
run: pnpm p:run
- name: prisma init
run: pnpm prisma generate && pnpm p:seed
- name: lint
run: pnpm lint
- name: Build
run: pnpm run build
- name: Run tests
run: pnpm run test:ci