-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from shapirogrill/2-create-ci
ci: add workflows actions and ci profile
- Loading branch information
Showing
3 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters