diff --git a/.github/workflows/testing.sh b/.github/workflows/testing.sh deleted file mode 100755 index 4f8300e0..00000000 --- a/.github/workflows/testing.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/bash - -set -eu -o pipefail - -export GRADLE_OPTS="-Xms128m" - -./gradlew clean assemble -x signArchives test --tests com.google.protobuf.gradle.ProtobufJavaPluginTest --stacktrace -./gradlew test --tests com.google.protobuf.gradle.ProtobufKotlinDslCopySpecTest --stacktrace -./gradlew test --tests com.google.protobuf.gradle.ProtobufKotlinDslPluginTest --stacktrace -./gradlew test --tests com.google.protobuf.gradle.ProtobufAndroidPluginTest --stacktrace -./gradlew -stop -./gradlew test --tests com.google.protobuf.gradle.ProtobufAndroidPluginKotlinTest --stacktrace -./gradlew test --tests com.google.protobuf.gradle.AndroidProjectDetectionTest --stacktrace -./gradlew codenarcMain || (cat ./build/reports/codenarc/main.txt && false) -./gradlew codenarcTest || (cat ./build/reports/codenarc/test.txt && false) diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml index 741aae1d..b9922310 100644 --- a/.github/workflows/testing.yml +++ b/.github/workflows/testing.yml @@ -9,17 +9,53 @@ on: permissions: contents: read +env: + GRADLE_OPTS: "-Xms128m" + jobs: - tests: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'temurin' + - uses: gradle/gradle-build-action@v2 + with: + arguments: clean assemble -x signArchives --stacktrace + + test: + needs: build + strategy: + matrix: + tests: [ProtobufJavaPluginTest, ProtobufKotlinDslCopySpecTest, ProtobufKotlinDslPluginTest, ProtobufAndroidPluginTest, ProtobufAndroidPluginKotlinTest, AndroidProjectDetectionTest] runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-java@v2 - with: - java-version: '8' - distribution: 'temurin' - cache: 'gradle' + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'temurin' + - uses: gradle/gradle-build-action@v2 + with: + arguments: test --tests ${{ matrix.tests }} --stacktrace - - name: Build - run: .github/workflows/testing.sh + codenarc: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-java@v2 + with: + java-version: '8' + distribution: 'temurin' + - uses: gradle/gradle-build-action@v2 + with: + arguments: codenarcMain codenarcTest --continue + - name: echo codenarcMain reports + if: failure() + run: test -f build/reports/codenarc/main.txt && cat build/reports/codenarc/main.txt + - name: echo codenarcTest reports + if: failure() + run: test -f build/reports/codenarc/test.txt && cat build/reports/codenarc/test.txt \ No newline at end of file