This is an automated email from the ASF dual-hosted git repository.

szetszwo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ratis.git


The following commit(s) were added to refs/heads/master by this push:
     new ff1a9891 RATIS-1579. Verify build from source release tarball in CI 
(#644)
ff1a9891 is described below

commit ff1a989130956c2baf18fff4db45d64a73c42337
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Fri May 13 12:01:34 2022 +0200

    RATIS-1579. Verify build from source release tarball in CI (#644)
---
 .github/workflows/post-commit.yml        | 42 +++++++++++++++++++++++++++++---
 dev-support/checks/build.sh              |  2 +-
 ratis-assembly/src/main/assembly/src.xml | 13 ++++++++++
 3 files changed, 52 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/post-commit.yml 
b/.github/workflows/post-commit.yml
index 7aee48a1..1ea5ef00 100644
--- a/.github/workflows/post-commit.yml
+++ b/.github/workflows/post-commit.yml
@@ -18,15 +18,49 @@ on:
   - pull_request
 jobs:
   build:
-    name: compile
+    runs-on: ubuntu-18.04
+    steps:
+      - name: Checkout project
+        uses: actions/checkout@v2
+      - name: Cache for maven dependencies
+        uses: actions/cache@v2
+        with:
+          path: ~/.m2/repository
+          key: maven-repo-${{ hashFiles('**/pom.xml') }}-${{ github.job }}
+          restore-keys: |
+            maven-repo-${{ hashFiles('**/pom.xml') }}
+            maven-repo-
+      - name: Setup java
+        uses: actions/setup-java@v1
+        with:
+          java-version: 8
+      - name: Run a full build
+        run: ./dev-support/checks/build.sh -Prelease assembly:single
+      - name: Store source tarball for compilation
+        uses: actions/upload-artifact@v2
+        with:
+          name: ratis-src
+          path: ratis-assembly/target/apache-ratis-*-src.tar.gz
+          retention-days: 1
+      - name: Delete temporary build artifacts
+        run: rm -rf ~/.m2/repository/org/apache/ratis
+        if: always()
+  compile:
+    needs:
+      - build
     runs-on: ubuntu-18.04
     strategy:
       matrix:
-        java: [ 8, 11 ]
+        java: [ 11 ]
       fail-fast: false
     steps:
-      - name: Checkout project
-        uses: actions/checkout@v2
+      - name: Download source tarball
+        uses: actions/download-artifact@v2
+        with:
+          name: ratis-src
+      - name: Untar sources
+        run: |
+          tar --strip-components 1 -xzvf apache-ratis-*-src.tar.gz
       - name: Cache for maven dependencies
         uses: actions/cache@v2
         with:
diff --git a/dev-support/checks/build.sh b/dev-support/checks/build.sh
index 2bddc2a3..ad029d62 100755
--- a/dev-support/checks/build.sh
+++ b/dev-support/checks/build.sh
@@ -17,5 +17,5 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 
&& pwd )"
 cd "$DIR/../.." || exit 1
 
 export MAVEN_OPTS="-Xmx4096m"
-mvn -V -B -Dmaven.javadoc.skip=true -DskipTests clean install
+mvn -V -B -Dmaven.javadoc.skip=true -DskipTests clean install "$@"
 exit $?
diff --git a/ratis-assembly/src/main/assembly/src.xml 
b/ratis-assembly/src/main/assembly/src.xml
index a28e4098..4207472b 100644
--- a/ratis-assembly/src/main/assembly/src.xml
+++ b/ratis-assembly/src/main/assembly/src.xml
@@ -74,6 +74,19 @@
       <outputDirectory>dev-support</outputDirectory>
       <fileMode>0644</fileMode>
       <directoryMode>0755</directoryMode>
+      <excludes>
+        <exclude>**/*.sh</exclude>
+      </excludes>
+    </fileSet>
+    <!-- Ensure shell scripts are executable -->
+    <fileSet>
+      <directory>${project.basedir}/../dev-support</directory>
+      <outputDirectory>dev-support</outputDirectory>
+      <fileMode>0755</fileMode>
+      <directoryMode>0755</directoryMode>
+      <includes>
+        <include>**/*.sh</include>
+      </includes>
     </fileSet>
     <!-- Include files in root dir -->
     <fileSet>

Reply via email to