Changement ci sans test

Signed-off-by: Gato <cedric@goutailler-olivier.fr>
This commit is contained in:
2026-06-07 11:15:15 +02:00
parent 0318884ae8
commit 89bbc322b7
2 changed files with 28 additions and 50 deletions
+28 -28
View File
@@ -8,37 +8,37 @@ on:
pull_request: pull_request:
jobs: jobs:
test: # test:
name: Tests # name: Tests
runs-on: ubuntu-latest # runs-on: ubuntu-latest
services: # services:
postgres: # postgres:
image: postgres:16 # image: postgres:16
env: # env:
POSTGRES_DB: olhar_test # POSTGRES_DB: olhar_test
POSTGRES_USER: olhar # POSTGRES_USER: olhar
POSTGRES_PASSWORD: olhar # POSTGRES_PASSWORD: olhar
ports: # ports:
- 5432:5432 # - 5432:5432
steps: # steps:
- name: Checkout # - name: Checkout
uses: actions/checkout@v4 # uses: actions/checkout@v4
- name: Build image de test # - name: Build image de test
run: docker build -f Dockerfile.test -t olhar-api-test:ci . # run: docker build -f Dockerfile.test -t olhar-api-test:ci .
- name: Lancer les tests # - name: Lancer les tests
run: | # run: |
docker run --rm \ # docker run --rm \
--network host \ # --network host \
-e SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/olhar_test \ # -e SPRING_DATASOURCE_URL=jdbc:postgresql://localhost:5432/olhar_test \
-e SPRING_DATASOURCE_USERNAME=olhar \ # -e SPRING_DATASOURCE_USERNAME=olhar \
-e SPRING_DATASOURCE_PASSWORD=olhar \ # -e SPRING_DATASOURCE_PASSWORD=olhar \
-e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver \ # -e SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.postgresql.Driver \
-e SECURITY_JWT_SECRET=test-secret-key-for-ci-testing-only-must-be-long-enough \ # -e SECURITY_JWT_SECRET=test-secret-key-for-ci-testing-only-must-be-long-enough \
olhar-api-test:ci \ # olhar-api-test:ci \
./gradlew test --no-daemon # ./gradlew test --no-daemon
build-and-push: build-and-push:
name: Build & push image Docker name: Build & push image Docker
-22
View File
@@ -1,22 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
REPO_ROOT=$(git rev-parse --show-toplevel)
BRANCH=$(git symbolic-ref --short HEAD)
echo "🔄 Pre-push : synchronisation avec origin/$BRANCH..."
if ! git pull --rebase origin "$BRANCH"; then
echo "❌ git pull --rebase a échoué — résous les conflits avant de pousser"
exit 1
fi
echo "🐳 Pre-push : build de l'image Docker de production..."
VERSION=$(grep '^version' "$REPO_ROOT/build.gradle" | awk -F"'" '{print $2}')
IMAGE="git.goutailler-olivier.com/gato/olhar-api:$VERSION"
if podman build -f "$REPO_ROOT/Dockerfile" -t "$IMAGE" "$REPO_ROOT"; then
echo "✅ Build Docker réussi ($IMAGE)"
else
echo "❌ Build Docker échoué — push annulé"
exit 1
fi