Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
50 changes: 42 additions & 8 deletions .github/workflows/gradle-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
build-changes: ${{ steps.filter.outputs.build }}
source-changes: ${{ steps.filter.outputs.java }}
steps:
- uses: actions/checkout@v5
with:
Expand All @@ -42,13 +43,50 @@ jobs:
- '**/*.gradle.kts'
- '**/gradle-build.yml'
- 'gradle.properties'
java:
- '**/*.java'

gradle-build:
name: Build project with Gradle
needs: check-changes
if: ${{ needs.check-changes.outputs.build-changes == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
add-job-summary-as-pr-comment: on-failure
build-scan-publish: true
build-scan-terms-of-use-url: "https://gradle.com/terms-of-service"
build-scan-terms-of-use-agree: "yes"
cache-encryption-key: ${{ secrets.GRADLE_ENCRYPTION_KEY }}
- name: Setup Testcontainers Cloud Client
uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}
- name: Run CI build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew check --configuration-cache
- name: Terminate Testcontainers Cloud Client active sessions
uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
action: terminate

code-quality:
name: Code Quality with Sonar
needs: check-changes
if: ${{ needs.check-changes.outputs.source-changes == 'true' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
Expand Down Expand Up @@ -76,16 +114,12 @@ jobs:
- name: Setup Testcontainers Cloud Client
uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
token: ${{ secrets.TC_CLOUD_TOKEN }}
- name: Run CI build
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew check --configuration-cache
token: ${{ secrets.TC_CLOUD_TOKEN }}
- name: Publish Sonar report
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew sonar
run: ./gradlew check sonar
- name: Terminate Testcontainers Cloud Client active sessions
uses: atomicjar/testcontainers-cloud-setup-action@v1
with:
action: terminate
action: terminate
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
import org.springframework.boot.test.context.TestConfiguration;
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.io.ClassPathResource;
import org.springframework.core.io.Resource;
import org.springframework.data.repository.init.Jackson2RepositoryPopulatorFactoryBean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import org.springframework.stereotype.Repository;

import static org.springframework.context.annotation.FilterType.ANNOTATION;
import static org.springframework.context.annotation.FilterType.ASSIGNABLE_TYPE;

/**
* @author Rashidi Zin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Subscription {
private Long id;
private final Long studentId;
private final Long courseId;
private Status status;
private final Status status;

public Subscription(Long studentId, Long courseId) {
this.studentId = studentId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
*/
class UserDeletionTestExecutionListener extends AbstractTestExecutionListener {

private static Logger log = LoggerFactory.getLogger(UserDeletionTestExecutionListener.class);
private static final Logger log = LoggerFactory.getLogger(UserDeletionTestExecutionListener.class);

@Override
public void afterTestClass(TestContext testContext) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.testcontainers.containers.MongoDBContainer;
import org.testcontainers.junit.jupiter.Container;
import org.testcontainers.junit.jupiter.Testcontainers;
import org.testcontainers.utility.DockerImageName;

/**
* @author Rashidi Zin
Expand Down
Loading