tuxji commented on code in PR #984:
URL: https://github.com/apache/daffodil/pull/984#discussion_r1131570773


##########
.github/workflows/main.yml:
##########
@@ -198,8 +188,55 @@ jobs:
           args: -Dproject.settings=.sonar-project.properties
 
 
-  # Ensure pull requests only have a single commit
+  # Lint checks that do not require compilation
+  lint:
+    name: Lint Checks
+    strategy:
+      fail-fast: false
+      matrix:
+        java_distribution: [ temurin ]
+        java_version: [ 17 ]
+        scala_version: [ 2.12.17 ]
+        os: [ ubuntu-22.04 ]
+    runs-on: ${{ matrix.os }}
+    env:
+      SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m 
-J-XX:MaxMetaspaceSize=1024m ++${{ matrix.scala_version }}
+    steps:
+
+      ############################################################
+      # Setup
+      ############################################################
+
+      - name: Check out Repository
+        uses: actions/[email protected]
+        with:
+          fetch-depth: 0

Review Comment:
   Can you add a comment why we're checking out with zero fetch-depth?



##########
.github/workflows/main.yml:
##########
@@ -198,8 +188,55 @@ jobs:
           args: -Dproject.settings=.sonar-project.properties
 
 
-  # Ensure pull requests only have a single commit
+  # Lint checks that do not require compilation
+  lint:
+    name: Lint Checks
+    strategy:
+      fail-fast: false
+      matrix:
+        java_distribution: [ temurin ]
+        java_version: [ 17 ]
+        scala_version: [ 2.12.17 ]
+        os: [ ubuntu-22.04 ]
+    runs-on: ${{ matrix.os }}
+    env:
+      SBT: sbt -J-Xms1024m -J-Xmx5120m -J-XX:ReservedCodeCacheSize=512m 
-J-XX:MaxMetaspaceSize=1024m ++${{ matrix.scala_version }}
+    steps:
+
+      ############################################################
+      # Setup
+      ############################################################
+
+      - name: Check out Repository
+        uses: actions/[email protected]
+        with:
+          fetch-depth: 0
+
+      - name: Setup Java
+        uses: actions/[email protected]
+        with:
+          distribution: ${{ matrix.java_distribution }}
+          java-version: ${{ matrix.java_version }}
+          cache: sbt
+
+      ############################################################
+      # Lint checks
+      ############################################################
 
+      - name: Run Rat Check
+        if: success() || failure()
+        run: $SBT ratCheck || (cat target/rat.txt; exit 1)
+
+      - name: Run OSGI Check
+        if: success() || failure()
+        run: $SBT osgiCheck
+
+      - name: Run scalafmt Check
+        if: success() || failure()

Review Comment:
   Nice use of `success() || failure()` instead of `always()`.  If a user or 
concurrency: group cancels the run, steps with `always()` still would be run 
but steps with `success() || failure()` will be skipped.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to