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://}"