diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96e3c74..a87a1ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,8 @@ on: - main jobs: - build-test: + typecheck: runs-on: ubuntu-latest - steps: - uses: actions/checkout@v4 @@ -25,30 +24,31 @@ jobs: - name: Install dependencies run: pnpm install - - name: Deploy migrations to database - run: pnpx prisma migrate deploy - env: - DATABASE_URL: ${{ secrets.DATABASE_URL }} - if: | - github.event_name != 'pull_request' && github.ref != 'refs/heads/develop' + - name: Run typecheck + run: pnpm ts:check - - uses: actions/cache@v4 + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - run: corepack enable + - uses: actions/setup-node@v4 with: - path: ${{ github.workspace }}/.next/cache - key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} - restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- + node-version: 20 + cache: "pnpm" - - name: Build application - run: pnpm build - env: - SKIP_ENV_VALIDATION: true + - name: Install dependencies + run: pnpm install - - name: Run all tests - run: pnpm test + - name: Run linter + run: | + pnpm lint + pnpm format:check env: SKIP_ENV_VALIDATION: true - lint: + tests: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -62,15 +62,14 @@ jobs: - name: Install dependencies run: pnpm install - - name: Run linter - run: | - pnpm lint - pnpm format:check + - name: Run all tests + run: pnpm test env: SKIP_ENV_VALIDATION: true - typecheck: + build-test: runs-on: ubuntu-latest + steps: - uses: actions/checkout@v4 @@ -83,5 +82,20 @@ jobs: - name: Install dependencies run: pnpm install - - name: Run typecheck - run: pnpm ts:check + - name: Deploy migrations to database + run: pnpx prisma migrate deploy + env: + DATABASE_URL: ${{ secrets.DATABASE_URL }} + if: | + github.event_name != 'pull_request' && github.ref != 'refs/heads/develop' + + - uses: actions/cache@v4 + with: + path: ${{ github.workspace }}/.next/cache + key: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }} + restore-keys: ${{ runner.os }}-nextjs-${{ hashFiles('**/pnpm-lock.yaml') }}- + + - name: Build application + run: pnpm build + env: + SKIP_ENV_VALIDATION: true