Skip to content

Fix SonarCloud: ganti CI on push and pull request #65

Fix SonarCloud: ganti CI on push and pull request

Fix SonarCloud: ganti CI on push and pull request #65

Workflow file for this run

name: Java CI Pipeline
on:
push:
pull_request:
jobs:
# build:
# name: Build
# runs-on: ubuntu-latest
# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
# - name: Set up JDK 21
# uses: actions/setup-java@v4
# with:
# distribution: "temurin"
# java-version: "21"
# cache: "gradle"
# - name: Cache Gradle dependencies
# uses: actions/cache@v4
# with:
# path: ~/.gradle/caches
# key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
# restore-keys: |
# ${{ runner.os }}-gradle-
# - name: Make gradlew executable
# run: chmod +x ./gradlew
# - name: Build with Gradle
# run: |
# ./gradlew assemble
# # (Optional) Add steps for running tests and generating reports
# - name: Upload Artifact
# uses: actions/upload-artifact@v4
# with:
# name: java-app
# path: build/libs/*.jar
test:

Check failure on line 44 in .github/workflows/ci.yml

View workflow run for this annotation

GitHub Actions / Java CI Pipeline

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yml (Line: 44, Col: 3): The workflow must contain at least one job with no dependencies.
name: Test
runs-on: ubuntu-latest
needs: build
services:
postgres:
image: postgres:latest
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: snackscription_review
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "21"
cache: "gradle"
- name: Make gradlew executable
run: chmod +x ./gradlew
- name: Cache Gradle dependencies
uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test with Gradle
run: |
./gradlew check --info --stacktrace
./gradlew test
./gradlew jacocoTestReport
env:
PRODUCTION: test
# (Optional) Add steps for generating coverage report and other post-test tasks