From fc81b9e1ace001fb0bdbd5fe4b865f9f32bd502c Mon Sep 17 00:00:00 2001 From: Youssef Date: Sun, 31 May 2026 00:54:07 +0200 Subject: [PATCH] =?UTF-8?q?ci:=20migration=20vers=20une=20architecture=20d?= =?UTF-8?q?e=20pipeline=20bas=C3=A9e=20sur=20des=20conteneurs=20d=C3=A9di?= =?UTF-8?q?=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/ci.yml | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml index 400ed5b..8c3215d 100644 --- a/.gitea/workflows/ci.yml +++ b/.gitea/workflows/ci.yml @@ -9,30 +9,36 @@ jobs: test: name: Build & Run Unit Tests runs-on: self-hosted + container: + image: maven:3.9.6-eclipse-temurin-21 steps: - name: Clone repository run: | + # Install git if not present in the maven image + if ! command -v git &> /dev/null; then + apt-get update && apt-get install -y git + fi SERVER_URL="${{ github.server_url }}" SERVER_NO_PROTO="${SERVER_URL#http://}" SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}" git clone --depth 1 "https://oauth2:${{ secrets.GITHUB_TOKEN }}@${SERVER_NO_PROTO}/${{ github.repository }}.git" . git checkout ${{ github.sha }} - - name: Run Maven Tests in Docker - run: | - docker run --rm \ - -v ${{ github.workspace }}:/as-talange \ - -w /as-talange \ - maven:3.9.6-eclipse-temurin-21 \ - mvn clean test + - name: Run Maven Tests + run: mvn clean test deploy: name: Build & Run in Docker Container needs: test runs-on: self-hosted + container: + image: docker:latest + volumes: + - /var/run/docker.sock:/var/run/docker.sock steps: - name: Clone repository run: | + apk add --no-cache git SERVER_URL="${{ github.server_url }}" SERVER_NO_PROTO="${SERVER_URL#http://}" SERVER_NO_PROTO="${SERVER_NO_PROTO#https://}"