Skip to content

Commit

Permalink
Attempt to fix CI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
melix committed Feb 3, 2023
1 parent 3039026 commit cae8593
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ jobs:
env:
GH_TOKEN_PUBLIC_REPOS_READONLY: ${{ secrets.GH_TOKEN_PUBLIC_REPOS_READONLY }}
GH_USERNAME: ${{ secrets.GH_USERNAME }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
- name: Publish Test Report
if: ${{ always() }}
uses: mikepenz/[email protected]
Expand All @@ -43,6 +46,9 @@ jobs:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_FILE: ${{ secrets.GPG_FILE }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
run: |
echo $GPG_FILE | base64 -d > secring.gpg
./gradlew publish
3 changes: 3 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ jobs:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GPG_FILE: ${{ secrets.GPG_FILE }}
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
GRADLE_ENTERPRISE_CACHE_USERNAME: ${{ secrets.GRADLE_ENTERPRISE_CACHE_USERNAME }}
GRADLE_ENTERPRISE_CACHE_PASSWORD: ${{ secrets.GRADLE_ENTERPRISE_CACHE_PASSWORD }}
run: |
echo $GPG_FILE | base64 -d > secring.gpg
./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
Expand Down
12 changes: 12 additions & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,13 @@
plugins {
id "com.gradle.enterprise" version "3.12.3"
}

rootProject.name = 'micronaut-build'

gradleEnterprise {
server = "https://ge.micronaut.io"
buildScan {
publishAlways()
publishIfAuthenticated()
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package io.micronaut.build.utils

import org.gradle.api.GradleException
import org.gradle.api.logging.Logger
import spock.lang.Specification

class GithubApiUtilsSpec extends Specification {

void "it is possible to fetch tags"() {
when:
String tags = new String(GithubApiUtils.fetchTagsFromGitHub(null, "micronaut-projects/micronaut-security"), "UTF-8")
String tags = new String(GithubApiUtils.fetchTagsFromGitHub(Stub(Logger), "micronaut-projects/micronaut-security"), "UTF-8")

then:
noExceptionThrown()
Expand All @@ -16,7 +17,7 @@ class GithubApiUtilsSpec extends Specification {

void "it is possible to fetch releases"() {
when:
String releases = new String(GithubApiUtils.fetchReleasesFromGitHub(null, "micronaut-projects/micronaut-security"), "UTF-8")
String releases = new String(GithubApiUtils.fetchReleasesFromGitHub(Stub(Logger), "micronaut-projects/micronaut-security"), "UTF-8")

then:
noExceptionThrown()
Expand All @@ -25,7 +26,7 @@ class GithubApiUtilsSpec extends Specification {

void "reports error"() {
given:
def logger = Mock(org.gradle.api.logging.Logger)
def logger = Mock(Logger)
when:
GithubApiUtils.fetchReleasesFromGitHub(logger, "micronaut-projects/nope")

Expand Down

0 comments on commit cae8593

Please sign in to comment.