Skip to content

Commit

Permalink
Merge pull request #9 from shapirogrill/2-create-ci
Browse files Browse the repository at this point in the history
ci: add workflows actions and ci profile
  • Loading branch information
shapirogrill authored Oct 4, 2024
2 parents 4ff87d0 + caa917c commit 4c89752
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 1 deletion.
43 changes: 43 additions & 0 deletions .github/workflows/code.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Java CI with Maven

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

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

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

- name: Set up Docker Compose
run: sudo apt-get install docker-compose

- name: Start Docker Compose services
run: docker-compose up -d

- name: Wait for services to be ready
run: |
echo "Waiting for services to be ready..."
while ! nc -z localhost 5432; do # Adapt this command depending on your DB or service port
sleep 2
done
- name: Build with Maven
run: mvn -B package --file pom.xml -DskipTests

- name: Run Tests
run: mvn test -Dspring.profiles.active=ci
9 changes: 9 additions & 0 deletions src/main/resources/application-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Jwt
JWT_SECRET: "SECRET JWT FOR CI DO NOT USE THIS IN PRODUCTION"
JWT_EXPIRATION_TIME: 1000

# Postgres
POSTGRES_DB: ideasmanager
POSTGRES_USER: ideasmanager
POSTGRES_PWD: ideasmanager
POSTGRES_HOST: localhost
2 changes: 1 addition & 1 deletion src/main/resources/application-local-template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ JWT_SECRET: SETME
JWT_EXPIRATION_TIME: 300000

# Postgres
POSTRGES_DB: SETME
POSTGRES_DB: SETME
POSTGRES_USER: SETME
POSTGRES_PWD: SETME
POSTGRES_HOST: SETME
Expand Down

0 comments on commit 4c89752

Please sign in to comment.