Skip to content

Commit

Permalink
ci: Separate test jobs depending on changed paths
Browse files Browse the repository at this point in the history
  • Loading branch information
Clashsoft committed Oct 13, 2023
1 parent e83f449 commit 720cef1
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 79 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test-backend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Test Backend

on:
push:
paths:
- 'backend/**'
pull_request:
paths:
- 'backend/**'

jobs:
backend:
name: Backend
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: adopt
java-version: 17
- name: Test Gradle
uses: gradle/gradle-build-action@v2
with:
arguments: test
build-root-directory: backend/
38 changes: 38 additions & 0 deletions .github/workflows/test-frontend.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Frontend

on:
push:
paths:
- 'frontend/**'
pull_request:
paths:
- 'frontend/**'

jobs:
frontend:
name: Frontend
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Set up Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'pnpm'
cache-dependency-path: frontend/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Audit
run: pnpm audit
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test:ci
38 changes: 38 additions & 0 deletions .github/workflows/test-services.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Test Services

on:
push:
paths:
- 'services/**'
pull_request:
paths:
- 'services/**'

jobs:
services:
name: Services
runs-on: ubuntu-latest
defaults:
run:
working-directory: services
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up pnpm
uses: pnpm/action-setup@v2
with:
version: latest
- name: Set up Node.js LTS
uses: actions/setup-node@v3
with:
node-version: 'lts/*'
cache: 'pnpm'
cache-dependency-path: services/pnpm-lock.yaml
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Audit
run: pnpm audit
- name: Lint
run: pnpm lint
- name: Test
run: pnpm test
79 changes: 0 additions & 79 deletions .github/workflows/test.yml

This file was deleted.

0 comments on commit 720cef1

Please sign in to comment.