Skip to content

Commit

Permalink
Merge pull request #1 from The-Socialites/Umi007-ci/cd
Browse files Browse the repository at this point in the history
Create ci.yml
  • Loading branch information
Umi007 authored Jun 18, 2024
2 parents 6688319 + 40a901f commit 405120c
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: CI Pipeline

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:13
ports:
- 5432:5432
env:
POSTGRES_DB: test_db
POSTGRES_USER: test_user
POSTGRES_PASSWORD: test_password
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Cache Maven dependencies
uses: actions/cache@v2
with:
path: ~/.m2
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Build with Maven
env:
DB_USERNAME: test_user
DB_PASSWORD: test_password
SPRING_PROFILES_ACTIVE: test
run: mvn clean install -X --debug

- name: Test with Maven
env:
DB_USERNAME: test_user
DB_PASSWORD: test_password
SPRING_PROFILES_ACTIVE: test
run: |
mvn test -X --debug

0 comments on commit 405120c

Please sign in to comment.