Skip to content

Merge pull request #237 from prgrms-be-devcourse/feat/jacoco-coverage… #252

Merge pull request #237 from prgrms-be-devcourse/feat/jacoco-coverage…

Merge pull request #237 from prgrms-be-devcourse/feat/jacoco-coverage… #252

Workflow file for this run

name: ci
on:
pull_request:
branches:
- develop
push:
branches:
- develop
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ci-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
checks:
name: checks
runs-on: ubuntu-latest
timeout-minutes: 40
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: maum_on_ci
POSTGRES_USER: maum_on
POSTGRES_PASSWORD: maum_on
ports:
- 5432:5432
options: >-
--health-cmd="pg_isready -U maum_on -d maum_on_ci"
--health-interval=10s
--health-timeout=5s
--health-retries=5
redis:
image: redis:latest
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
CI: "true"
GOOGLE_API_KEY: test_key_dummy
DEV_DB_URL: jdbc:postgresql://localhost:5432/maum_on_ci
DEV_DB_USERNAME: maum_on
DEV_DB_PASSWORD: maum_on
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Java 21
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "21"
cache: gradle
- name: Ensure Gradle wrapper is executable
run: chmod +x ./gradlew
working-directory: back
- name: Compile backend sources
run: ./gradlew --no-daemon compileJava compileTestJava
working-directory: back
- name: Run backend tests
run: ./gradlew --no-daemon test
working-directory: back
- name: Set up Node 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: npm
cache-dependency-path: front/package-lock.json
- name: Install frontend dependencies
run: npm ci
working-directory: front
- name: Lint frontend
run: npm run lint
working-directory: front
- name: Run frontend tests
run: npm run test
working-directory: front
- name: Build frontend
run: npm run build
working-directory: front