Skip to content

Commit

Permalink
separate test workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
juancwu committed Nov 25, 2024
1 parent a670763 commit b81bc2a
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 41 deletions.
45 changes: 4 additions & 41 deletions .github/workflows/test.yml → .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,16 @@
on:
push:
branches: ['main', 'staging', 'prod']
paths:
- 'backend/**'
pull_request:
branches: ['main', 'staging', 'prod']
paths:
- 'backend/**'
jobs:
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./frontend
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Check ls
run: ls
- name: NPM install
run: npm install -g pnpm
working-directory: ./frontend
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
working-directory: ./frontend
- name: Run tests
run: pnpm test:ci
working-directory: ./frontend
- name: Generate coverage report
run: pnpm coverage
working-directory: ./frontend
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report-frontend
path: coverage/
test-backend:
name: Test Backend
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./backend
services:
postgres:
image: postgres:16
Expand Down
37 changes: 37 additions & 0 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
on:
push:
branches: ['main', 'staging', 'prod']
paths:
- 'frontend/**'
pull_request:
branches: ['main', 'staging', 'prod']
paths:
- 'frontend/**'
jobs:
test-frontend:
name: Test Frontend
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
run_install: false
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'pnpm'
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run tests
run: pnpm test:ci
- name: Generate coverage report
run: pnpm coverage
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report-frontend
path: coverage/

0 comments on commit b81bc2a

Please sign in to comment.