generated from CodelyTV/java-basic-skeleton
-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f324ae9
commit 56ee039
Showing
2 changed files
with
18 additions
and
17 deletions.
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 |
---|---|---|
@@ -1,24 +1,31 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v1 | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Start all the environment | ||
run: docker-compose up -d | ||
- name: 🐳 Start all the environment | ||
run: make start | ||
|
||
- name: Wait for the environment to get up | ||
- name: 🔦 Lint | ||
run: make lint | ||
|
||
- name: 🦭 Wait for the environment to get up | ||
run: | | ||
while ! make ping-mysql &>/dev/null; do | ||
echo "Waiting for database connection..." | ||
sleep 2 | ||
done | ||
- name: Run the tests | ||
- name: ✅ Run the tests | ||
run: make test |
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 |
---|---|---|
@@ -1,35 +1,29 @@ | ||
.PHONY: all | ||
all: build | ||
|
||
.PHONY: up | ||
up: | ||
@docker-compose up -d | ||
start: | ||
@docker compose up -d | ||
|
||
.PHONY: build | ||
build: | ||
@./gradlew build --warning-mode all | ||
|
||
.PHONY: run-tests | ||
lint: | ||
@docker exec codelytv-ddd_example-java ./gradlew spotlessCheck | ||
|
||
run-tests: | ||
@./gradlew test --warning-mode all | ||
|
||
.PHONY: test | ||
test: | ||
@docker exec codelytv-ddd_example-java ./gradlew test --warning-mode all | ||
|
||
.PHONY: run | ||
run: | ||
@./gradlew :run | ||
|
||
.PHONY: ping-mysql | ||
ping-mysql: | ||
@docker exec codelytv-java_ddd_example-mysql mysqladmin --user=root --password= --host "127.0.0.1" ping --silent | ||
|
||
# Start the app | ||
.PHONY: start-mooc_backend | ||
start-mooc_backend: | ||
@./gradlew bootRun --args='mooc_backend server' | ||
|
||
.PHONY: start-backoffice_frontend | ||
start-backoffice_frontend: | ||
@./gradlew bootRun --args='backoffice_frontend server' |