Skip to content

Commit

Permalink
GitHub Actions: make ./gradlew clean an independent pipeline step (#…
Browse files Browse the repository at this point in the history
…2931)

Motivation:

Jakarta modules have some conflicts between `clean` and `check` tasks when they are executed for 2+ modules in a single run.

Modification:

- Run `clean` as an independent task;

Result:

We expect snapshot build pipelines to recover.
  • Loading branch information
idelpivnitskiy authored May 14, 2024
1 parent f0e7aff commit af629a8
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci-netty-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,13 @@ jobs:
env:
ORG_GRADLE_PROJECT_nettyVersion: 4.1+
run: ./gradlew :servicetalk-grpc-netty:dependencyInsight --configuration testRuntimeClasspath --dependency io.netty:netty-codec-http2 -PnettyVersion=4.1+ | grep "io.netty:netty-codec-http2"
- name: Clean Gradle project
run: ./gradlew --parallel clean
- name: Build and Test
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
ORG_GRADLE_PROJECT_nettyVersion: 4.1.+
run: sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel clean test"
run: sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel test"
- name: Publish Test Results
if: always()
uses: actions/upload-artifact@v4
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ci-prb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
run: java -version
- name: Make gradlew Executable
run: chmod +x gradlew
- name: Clean Gradle project
run: ./gradlew --parallel clean
# https://github.community/t/error-the-paging-file-is-too-small-for-this-operation-to-complete/17141
- name: Configure Windows Pagefile
if: ${{ runner.os == 'Windows' }}
Expand All @@ -35,12 +37,12 @@ jobs:
if: runner.os == 'Linux'
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
run: sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel clean test"
run: sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel test"
- name: Build and Test (non-Linux)
if: runner.os != 'Linux'
env:
JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
run: ./gradlew --no-daemon --parallel clean test
run: ./gradlew --no-daemon --parallel test
- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/ci-prq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ jobs:
run: chmod +x gradlew
- name: Documentation Linter
run: bash scripts/check-source-root.sh
- name: Clean Gradle project
run: ./gradlew --parallel clean
- name: Build with Gradle
run: ./gradlew --parallel clean quality
run: ./gradlew --parallel quality
- name: Upload CheckStyle Results
if: always()
uses: actions/upload-artifact@v4
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ jobs:
run: java -version
- name: Make gradlew Executable
run: chmod +x gradlew
- name: Clean Gradle project
run: ./gradlew --parallel clean
- name: Build with Gradle
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
Expand All @@ -35,7 +37,7 @@ jobs:
run: |
# Build arguments to feed to the single gradlew publish command
if [ "${{ matrix.java }}" = "8" ]; then
FIRST_GRADLE_TARGETS=" clean check"
FIRST_GRADLE_TARGETS=" check"
SECOND_GRADLE_TARGETS=" --no-parallel publish"
else
FIRST_GRADLE_TARGETS=""
Expand All @@ -49,14 +51,14 @@ jobs:
if [ "$javaTarget" = "1.9" ] || [ "$javaTarget" = "1.10" ] || [ "$javaTarget" -gt "8" ] 2> /dev/null
then
currDir=$(echo "$line" | sed -e 's/^version:.* name: \(.*\)$/\1/g')
FIRST_GRADLE_TARGETS="$FIRST_GRADLE_TARGETS :$currDir:clean :$currDir:check"
FIRST_GRADLE_TARGETS="$FIRST_GRADLE_TARGETS :$currDir:check"
SECOND_GRADLE_TARGETS="$SECOND_GRADLE_TARGETS :$currDir:publish"
fi
done < <(./gradlew printJavaTargetCompatibility)
fi
# Execute the gradlew command to publish the build
sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel -PreleaseBuild=true$FIRST_GRADLE_TARGETS && ./gradlew --no-daemon -PreleaseBuild=true$SECOND_GRADLE_TARGETS"
sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel -PreleaseBuild=true$FIRST_GRADLE_TARGETS && ./gradlew --no-daemon --no-parallel -PreleaseBuild=true$SECOND_GRADLE_TARGETS"
- name: Publish Test Results
if: always()
uses: scacap/action-surefire-report@a2911bd1a4412ec18dde2d93b1758b3e56d2a880
Expand Down
8 changes: 5 additions & 3 deletions .github/workflows/ci-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:
run: java -version
- name: Make gradlew Executable
run: chmod +x gradlew
- name: Clean Gradle project
run: ./gradlew --parallel clean
- name: Build with Gradle
env:
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
Expand All @@ -36,7 +38,7 @@ jobs:
run: |
# Build arguments to feed to the single gradlew publish command
if [ "${{ matrix.java }}" = "8" ]; then
FIRST_GRADLE_TARGETS=" clean check"
FIRST_GRADLE_TARGETS=" check"
SECOND_GRADLE_TARGETS=" publish"
else
FIRST_GRADLE_TARGETS=""
Expand All @@ -50,14 +52,14 @@ jobs:
if [ "$javaTarget" = "1.9" ] || [ "$javaTarget" = "1.10" ] || [ "$javaTarget" -gt "8" ] 2> /dev/null
then
currDir=$(echo "$line" | sed -e 's/^version:.* name: \(.*\)$/\1/g')
FIRST_GRADLE_TARGETS="$FIRST_GRADLE_TARGETS :$currDir:clean :$currDir:check"
FIRST_GRADLE_TARGETS="$FIRST_GRADLE_TARGETS :$currDir:check"
SECOND_GRADLE_TARGETS="$SECOND_GRADLE_TARGETS :$currDir:publish"
fi
done < <(./gradlew printJavaTargetCompatibility)
fi
# Execute the gradlew command to publish the build
sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel$FIRST_GRADLE_TARGETS && ./gradlew --no-daemon$SECOND_GRADLE_TARGETS"
sudo -E env "PATH=$PATH" bash -c "ulimit -l 65536 && ulimit -a && ./gradlew --no-daemon --parallel$FIRST_GRADLE_TARGETS && ./gradlew --no-daemon --no-parallel$SECOND_GRADLE_TARGETS"
- name: Publish Test Results
if: always()
uses: scacap/action-surefire-report@a2911bd1a4412ec18dde2d93b1758b3e56d2a880
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ jobs:
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
- name: Execute gradle build
run: ./gradlew --parallel clean assemble
- name: Clean Gradle project
run: ./gradlew --parallel clean
- name: Assemble Gradle project
run: ./gradlew --parallel assemble
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3

0 comments on commit af629a8

Please sign in to comment.