Skip to content

test: ScrapService 단위 테스트 추가 + 스크랩 취소 NPE 수정 #81

test: ScrapService 단위 테스트 추가 + 스크랩 취소 NPE 수정

test: ScrapService 단위 테스트 추가 + 스크랩 취소 NPE 수정 #81

Workflow file for this run

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
name: RUNNECT CI
on:
pull_request:
branches: [ "dev" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
# 테스트(contextLoads 등)는 실제 dev DB/Redis가 아니라 CI 안에서 띄우는
# 임시 컨테이너를 바라보게 한다 (원격 dev 환경은 GitHub Actions 러너에서 네트워크가 닿지 않음).
services:
postgres:
image: postgres:15
env:
POSTGRES_DB: runnect
POSTGRES_USER: runnect
POSTGRES_PASSWORD: runnect_local_password
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
redis:
image: redis:7
ports:
- 6379:6379
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: 'gradle'
- name: make application.properties 파일 생성
run: |
## create application.yml
mkdir -p ./src/main/resources
cd ./src/main/resources
# application.yml 파일 생성
touch ./application.yml
# GitHub-Actions 에서 설정한 값을 application.yml 파일에 쓰기
echo "${{ secrets.RUNNECT_DEV_APPLICATION }}" >> ./application.yml
# application.yml 파일 확인
cat ./application.yml
shell: bash
# 이 워크플로우는 gradle build
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle # 실제 application build
run: ./gradlew build -PactiveProfiles=local
env:
SPRING_DATASOURCE_URL: jdbc:postgresql://localhost:5432/runnect
SPRING_DATASOURCE_USERNAME: runnect
SPRING_DATASOURCE_PASSWORD: runnect_local_password
SPRING_DATA_REDIS_HOST: localhost