diff --git a/.github/workflows/ci-cd-java.yml b/.github/workflows/ci-cd-java.yml index 5678f5e..d7f5b0d 100644 --- a/.github/workflows/ci-cd-java.yml +++ b/.github/workflows/ci-cd-java.yml @@ -11,6 +11,8 @@ on: required: true DOCKER_PASSWORD: required: true + CODECOV_TOKEN: + required: true inputs: # it is required for backwards compatibility with CI/CD pipelines that have not been yet fully migrated to shared workflows uploadJarArtifact: @@ -68,15 +70,34 @@ jobs: - name: Run tests outside Docker working-directory: ${{ inputs.workingDirectory }} - run: mvn test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + JAVA_TOOL_OPTIONS: "" + MAVEN_OPTS: "" + run: mvn -B test - name: Run Integration tests (Testcontainers) working-directory: ${{ inputs.workingDirectory }} - run: mvn verify env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + DOCKER_HOST: unix:///var/run/docker.sock + TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE: /var/run/docker.sock + JAVA_TOOL_OPTIONS: "" + MAVEN_OPTS: "" + run: mvn -B verify + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Build artifact working-directory: ${{ inputs.workingDirectory }} @@ -159,7 +180,7 @@ jobs: if: ${{ env.PERFORM_RELEASE == 'true' }} uses: docker/setup-buildx-action@v3 - - name: Login to Github Container Registry + - name: Login to Docker Hub if: ${{ env.PERFORM_RELEASE == 'true' }} uses: docker/login-action@v3 with: @@ -173,4 +194,4 @@ jobs: context: ${{ inputs.workingDirectory }} push: ${{ env.PERFORM_RELEASE }} tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/ci-cd-kotlin.yml b/.github/workflows/ci-cd-kotlin.yml index 299adcb..60a25a8 100644 --- a/.github/workflows/ci-cd-kotlin.yml +++ b/.github/workflows/ci-cd-kotlin.yml @@ -1,4 +1,9 @@ name: ci-cd-kotlin.yml + +permissions: + contents: read + packages: read + on: workflow_call: secrets: @@ -6,6 +11,8 @@ on: required: true DOCKER_PASSWORD: required: true + CODECOV_TOKEN: + required: true inputs: uploadJarArtifact: required: false @@ -44,12 +51,30 @@ jobs: cache: 'gradle' - name: Check code format and lint - run: ./gradlew spotlessApply + run: ./gradlew spotlessCheck env: + GITHUB_ACTOR: ${{ github.actor }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Run tests - run: ./gradlew test + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + ./gradlew test jacocoTestReport --stacktrace + + - name: Upload coverage reports to Codecov + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true + + - name: Upload test results to Codecov + if: ${{ !cancelled() }} + uses: codecov/test-results-action@v1 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Upload .jar artifact if: ${{ inputs.uploadJarArtifact }} @@ -60,6 +85,9 @@ jobs: - name: Build artifact run: ./gradlew build -x test + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Lowercase Docker Image Name run: | @@ -117,4 +145,4 @@ jobs: context: . push: ${{ env.PERFORM_RELEASE }} tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} \ No newline at end of file + labels: ${{ steps.meta.outputs.labels }} diff --git a/.github/workflows/ci-cd-typescript.yml b/.github/workflows/ci-cd-typescript.yml index 6a814dc..c94f815 100644 --- a/.github/workflows/ci-cd-typescript.yml +++ b/.github/workflows/ci-cd-typescript.yml @@ -6,15 +6,13 @@ on: required: true DOCKER_PASSWORD: required: true + CODECOV_TOKEN: + required: true inputs: checkAndTestOutsideDocker: required: false type: boolean default: false - codeCoverageEnabled: - required: false - type: boolean - default: false performRelease: required: false type: boolean @@ -52,16 +50,19 @@ jobs: - name: Check and test outside Docker if: ${{ inputs.checkAndTestOutsideDocker }} - run: npm run check-and-build + run: | + npm run check-and-build + npm run test -- --coverage - name: Upload coverage reports to Codecov - if: ${{ inputs.codeCoverageEnabled }} uses: codecov/codecov-action@v5 with: token: ${{ secrets.CODECOV_TOKEN }} + fail_ci_if_error: true + verbose: true - name: Upload test results to Codecov - if: ${{ inputs.codeCoverageEnabled && !cancelled() }} + if: ${{ !cancelled() }} uses: codecov/test-results-action@v1 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 723ef36..b79d2d6 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.idea \ No newline at end of file +.idea +/AGENTS.md