Skip to content

Commit

Permalink
Merge branch 'main' into script-tag-in-style
Browse files Browse the repository at this point in the history
  • Loading branch information
bgalek authored Sep 16, 2024
2 parents 1bb95b7 + f24338e commit a5314ce
Show file tree
Hide file tree
Showing 7 changed files with 220 additions and 171 deletions.
38 changes: 13 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: Build
on: [push, pull_request]
on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:
permissions:
contents: write
pull-requests: write
Expand All @@ -8,33 +12,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
- uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: temurin
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Cache Gradle packages
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Test with Gradle
run: ./gradlew --no-daemon --continue check javadoc
- name: Jacoco
run: ./gradlew jacocoTestReport
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
- name: Analyze with SonarCloud
if: github.ref == 'refs/heads/main'
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew build
- run: ./gradlew jacocoTestReport
- uses: codecov/codecov-action@v4
- if: github.ref_name == github.event.repository.default_branch
run: ./gradlew sonarqube -Dsonar.login=${SONAR_TOKEN} -Dsonar.projectKey=bgalek_safe-svg -Dsonar.organization=bgalek-github -Dsonar.host.url=https://sonarcloud.io
env:
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
dependabot:
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,17 @@
name: Publish

on:
release:
types: [ created ]

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
fetch-depth: 0
- uses: gradle/wrapper-validation-action@v3
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
java-version: 21
distribution: temurin
- uses: gradle/actions/setup-gradle@v4
- name: Publish to maven central
run: ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
Expand Down
14 changes: 4 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ java {
withSourcesJar()
withJavadocJar()
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
languageVersion.set(JavaLanguageVersion.of(21))
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}

Expand All @@ -44,17 +46,9 @@ tasks.withType<Test> {
}
}

jacoco {
toolVersion = "0.8.6"
reportsDir = file("$buildDir/reports/jacoco")
}

tasks.jacocoTestReport {
reports {
xml.isEnabled = true
xml.destination = file("$buildDir/reports/jacoco/report.xml")
csv.isEnabled = false
html.isEnabled = false
xml.required = true
}
}

Expand Down
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 3 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit a5314ce

Please sign in to comment.