Fix(ci): Correct Docker setup in CI workflow #541
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Java CI with Gradle and Testcontainers | |
| on: | |
| push: | |
| branches: [ "main", "develop", "master" ] | |
| pull_request: | |
| branches: [ "main", "develop", "master" ] | |
| jobs: | |
| build-and-test: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Wait for Docker to be fully ready | |
| run: | | |
| echo "Docker is ready." | |
| docker info | |
| docker ps -a | |
| - name: Run tests (capture full Gradle output) | |
| run: | | |
| set -o pipefail | |
| cd backend | |
| ./gradlew clean build integrationTest jacocoTestReport --no-daemon --stacktrace --console=plain 2>&1 | tee build.log | |
| - name: Upload Gradle build log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: gradle-build-log | |
| path: backend/build.log | |
| - name: Upload jacoco report | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: jacoco-report | |
| path: backend/build/reports/jacoco/test/ | |
| if-no-files-found: warn | |
| - name: Upload coverage to Codecov | |
| if: success() && github.event_name == 'push' | |
| uses: codecov/codecov-action@v4 | |
| continue-on-error: true | |
| with: | |
| files: backend/build/reports/jacoco/test/jacocoTestReport.xml | |
| flags: unittests | |
| name: codecov-phoebe | |
| fail_ci_if_error: false | |
| token: ${{ secrets.CODECOV_TOKEN }} |