Skip to content

Commit

Permalink
feat: update CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
SecondThundeR committed Feb 25, 2024
1 parent 7a1c150 commit f6cbc13
Showing 1 changed file with 40 additions and 26 deletions.
66 changes: 40 additions & 26 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ on:
- main

jobs:
build-test:
typecheck:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

Expand All @@ -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
Expand All @@ -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

Expand All @@ -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

0 comments on commit f6cbc13

Please sign in to comment.