Skip to content

Commit

Permalink
ci: add linter
Browse files Browse the repository at this point in the history
  • Loading branch information
rgomezcasas committed Nov 7, 2023
1 parent f324ae9 commit 56ee039
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
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
16 changes: 5 additions & 11 deletions Makefile
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'

0 comments on commit 56ee039

Please sign in to comment.