Repository: railwayapp/nixpacks
Pull request #515 (2022-09-09 23:00:42)

Exclude check step from Gradle build
<!-- Thanks for sending a pull request! -->
<!-- Please add a useful description explaining what this PR does -->

Some builds can be broken because of this `check` step, Excluding to focus on real build step.

<!-- PR Checklist  -->
<!-- - [ ] Tests are added/updated if needed  -->
<!-- - [ ] Docs are updated if needed  -->



Patch:
diff --git a/.github/workflows/label-check.yml b/.github/workflows/label-check.yml
new file mode 100644
index 0000000..09db1ff
--- /dev/null
+++ b/.github/workflows/label-check.yml
@@ -0,0 +1,16 @@
+name: Release Label Check
+
+on:
+  pull_request_target:
+    types: [opened, labeled, unlabeled, synchronize]
+
+jobs:
+  label-check:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: jesusvasquez333/verify-pr-label-action@v1.4.0
+        with:
+          github-token: "${{ secrets.GITHUB_TOKEN }}"
+          valid-labels: "release/patch, release/minor, release/major"
+          pull-request-number: '${{ github.event.pull_request.number }}'
+          disable-reviews: true
\ No newline at end of file
diff --git a/.github/workflows/tag.yml b/.github/workflows/tag.yml
new file mode 100644
index 0000000..7bbf832
--- /dev/null
+++ b/.github/workflows/tag.yml
@@ -0,0 +1,35 @@
+name: Tag
+
+on:
+  push:
+    branches:
+      - main
+
+jobs:
+  tag:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+
+      - uses: actions-ecosystem/action-get-merged-pull-request@v1
+        id: get-merged-pull-request
+        with:
+          github_token: ${{ secrets.GH_PAT }}
+
+      - uses: actions-ecosystem/action-release-label@v1
+        id: release-label
+        if: ${{ steps.get-merged-pull-request.outputs.title != null }}
+        with:
+          github_token: ${{ secrets.GH_PAT }}
+          labels: ${{ steps.get-merged-pull-request.outputs.labels }}
+      
+      - uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+      
+      - run: echo 'Dry Run PATCH' # cargo release patch --execute
+        if: ${{ steps.release-label.outputs.level == 'release/patch' }}
+      - run: echo 'Dry Run MINOR' # cargo release minor --execute
+        if: ${{ steps.release-label.outputs.level == 'release/minor' }}
+      - run: echo 'Dry Run MAJOR' # cargo release major --execute
+        if: ${{ steps.release-label.outputs.level == 'release/major' }}
\ No newline at end of file
diff --git a/src/providers/java.rs b/src/providers/java.rs
index fe0f00e..5181ca9 100644
--- a/src/providers/java.rs
+++ b/src/providers/java.rs
@@ -37,7 +37,7 @@ impl Provider for JavaProvider {
             setup = Phase::setup(Some(pkgs));
 
             let gradle_exe = self.get_gradle_exe(app);
-            let mut build = Phase::build(Some(format!("{} build", gradle_exe)));
+            let mut build = Phase::build(Some(format!("{} build -x check", gradle_exe)));
             build.add_cache_directory(".gradle");
             build
         } else {


Test patch:
diff --git a/tests/snapshots/generate_plan_tests__java_gradle_hello_world.snap b/tests/snapshots/generate_plan_tests__java_gradle_hello_world.snap
index 4a95819..e53313c 100644
--- a/tests/snapshots/generate_plan_tests__java_gradle_hello_world.snap
+++ b/tests/snapshots/generate_plan_tests__java_gradle_hello_world.snap
@@ -15,7 +15,7 @@ expression: plan
         "setup"
       ],
       "cmds": [
-        "./gradlew build"
+        "./gradlew build -x check"
       ],
       "cacheDirectories": [
         ".gradle"
diff --git a/tests/snapshots/generate_plan_tests__java_spring_boot.snap b/tests/snapshots/generate_plan_tests__java_spring_boot.snap
index e9deb7b..c60a8b2 100644
--- a/tests/snapshots/generate_plan_tests__java_spring_boot.snap
+++ b/tests/snapshots/generate_plan_tests__java_spring_boot.snap
@@ -15,7 +15,7 @@ expression: plan
         "setup"
       ],
       "cmds": [
-        "./gradlew build"
+        "./gradlew build -x check"
       ],
       "cacheDirectories": [
         ".gradle"