diff --git a/.github/workflows/java-ci.yml b/.github/workflows/java-ci.yml index a2739c1..a63d00b 100644 --- a/.github/workflows/java-ci.yml +++ b/.github/workflows/java-ci.yml @@ -1,13 +1,9 @@ name: Java CI on: - schedule: - - cron: '0 0 * * *' push: branches: [ master ] tags: [ 'v[0-9]+.[0-9]+.[0-9]+' ] - pull_request: - branches: [ master ] workflow_dispatch: diff --git a/.github/workflows/scheduled-test.yml b/.github/workflows/scheduled-test.yml new file mode 100644 index 0000000..5e6b0e4 --- /dev/null +++ b/.github/workflows/scheduled-test.yml @@ -0,0 +1,63 @@ +name: Java SDK Scheduled Test + +on: + schedule: + - cron: '0 8 * * 1' + + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + java-versions: [ 11, 17, 19 ] + fail-fast: false + steps: + - uses: actions/checkout@v5 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: ${{ matrix.java-versions }} + distribution: zulu + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Test with Gradle + run: ./gradlew test --stacktrace + + coverage-scan: + 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: 17 + distribution: zulu + cache: gradle + + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Check with Gradle + run: ./gradlew check --stacktrace + + - name: Execute sonar scan + run: ./gradlew sonar -Dbuild.number=$GITHUB_RUN_NUMBER + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..6c93016 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,66 @@ +name: Java SDK Test + +on: + push: + branches-ignore: + - master + pull_request: + branches: [ master ] + + workflow_dispatch: + +jobs: + test: + runs-on: ubuntu-latest + strategy: + matrix: + java-versions: [ 11, 17, 19 ] + fail-fast: false + steps: + - uses: actions/checkout@v5 + + - name: Set up JDK + uses: actions/setup-java@v5 + with: + java-version: ${{ matrix.java-versions }} + distribution: zulu + cache: gradle + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Test with Gradle + run: ./gradlew test --stacktrace + + coverage-scan: + 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: 17 + distribution: zulu + cache: gradle + + - name: Cache SonarCloud packages + uses: actions/cache@v4 + with: + path: ~/.sonar/cache + key: ${{ runner.os }}-sonar + restore-keys: ${{ runner.os }}-sonar + + - name: Grant execute permission for gradlew + run: chmod +x gradlew + + - name: Check with Gradle + run: ./gradlew check --stacktrace + + - name: Execute sonar scan + run: ./gradlew sonar -Dbuild.number=$GITHUB_RUN_NUMBER + env: + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index ae4d7df..0ee9a23 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1,2 @@ version=9.4.4 +SONATYPE_CONNECT_TIMEOUT_SECONDS=120 \ No newline at end of file