ctubbsii commented on code in PR #2593:
URL: https://github.com/apache/thrift/pull/2593#discussion_r861159853


##########
.github/workflows/build.yml:
##########
@@ -45,3 +45,111 @@ jobs:
 
       - name: Run thrift version
         run: /usr/local/bin/thrift -version
+
+      # only upload while building ubuntu-20.04
+      - name: Archive built thrift compiler
+        if: matrix.os == 'ubuntu-20.04'
+        uses: actions/upload-artifact@v3
+        with:
+          name: thrift-compiler
+          path: compiler/cpp/thrift
+          retention-days: 3
+
+  build-java-and-kotlin:
+    needs: build-thrift-compiler-ubuntu
+    strategy:
+      matrix:
+        java: [8, 11]
+        distribution: ['temurin']
+        os: [ubuntu-20.04]
+    runs-on: ${{ matrix.os }}
+    env:
+      GRADLE_VERSION: 6.9.2
+    steps:
+      - uses: actions/checkout@v3
+
+      - uses: actions/setup-java@v3
+        with:
+          distribution: ${{ matrix.distribution }}
+          java-version: ${{ matrix.java }}
+          cache: 'gradle'
+
+      - name: Install dependencies
+        run: |
+          # 
https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners

Review Comment:
   This step is going to occur on each job. You could consolidate the 
installation of dependencies into a script that is called in each job, rather 
than inline the script, which results in a lot of duplicate apt-get stuff.



##########
.github/workflows/build.yml:
##########
@@ -45,3 +45,111 @@ jobs:
 
       - name: Run thrift version
         run: /usr/local/bin/thrift -version
+
+      # only upload while building ubuntu-20.04
+      - name: Archive built thrift compiler
+        if: matrix.os == 'ubuntu-20.04'
+        uses: actions/upload-artifact@v3
+        with:
+          name: thrift-compiler
+          path: compiler/cpp/thrift
+          retention-days: 3
+
+  build-java-and-kotlin:
+    needs: build-thrift-compiler-ubuntu
+    strategy:
+      matrix:
+        java: [8, 11]
+        distribution: ['temurin']
+        os: [ubuntu-20.04]
+    runs-on: ${{ matrix.os }}
+    env:
+      GRADLE_VERSION: 6.9.2
+    steps:
+      - uses: actions/checkout@v3
+
+      - uses: actions/setup-java@v3
+        with:
+          distribution: ${{ matrix.distribution }}
+          java-version: ${{ matrix.java }}
+          cache: 'gradle'
+
+      - name: Install dependencies
+        run: |
+          # 
https://docs.github.com/en/actions/using-github-hosted-runners/customizing-github-hosted-runners
+          sudo apt-get update -yq
+          sudo apt-get install -y --no-install-recommends \
+            automake \
+            bison \
+            flex \
+            g++ \
+            git \
+            libboost-all-dev \
+            libevent-dev \
+            libssl-dev \
+            libtool \
+            make \
+            pkg-config \
+            wget \
+            unzip \
+            curl \
+            ant \
+            maven
+
+      - name: Setup gradle
+        run: |
+          wget 
https://services.gradle.org/distributions/gradle-$GRADLE_VERSION-bin.zip -q -O 
/tmp/gradle-$GRADLE_VERSION-bin.zip
+          (echo 
"8b356fd8702d5ffa2e066ed0be45a023a779bba4dd1a68fd11bc2a6bdc981e8f  
/tmp/gradle-$GRADLE_VERSION-bin.zip" | sha256sum -c -)
+          unzip -d /tmp /tmp/gradle-$GRADLE_VERSION-bin.zip
+          sudo mv /tmp/gradle-$GRADLE_VERSION /usr/local/gradle
+          sudo ln -s /usr/local/gradle/bin/gradle /usr/local/bin
+          gradle --version
+
+      - name: Run bootstrap
+        run: ./bootstrap.sh
+
+      - name: Run configure
+        run: |
+          ./configure \
+            --disable-debug \
+            --disable-tests \
+            --disable-dependency-tracking \
+            --without-cpp \
+            --without-c_glib \
+            --with-java \
+            --with-kotlin \
+            --without-python \
+            --without-py3 \
+            --without-ruby \
+            --without-haxe \
+            --without-netstd \
+            --without-perl \
+            --without-php \
+            --without-php_extension \
+            --without-dart \
+            --without-erlang \
+            --without-go \
+            --without-d \
+            --without-nodejs \
+            --without-nodets \
+            --without-lua \
+            --without-rs \
+            --without-swift
+
+      - uses: actions/download-artifact@v3
+        with:
+          name: thrift-compiler
+          path: compiler/cpp/
+
+      - name: Run thrift-compiler
+        run: |
+          # we do a touch to make sure it's newer than the makefile
+          touch compiler/cpp/thrift

Review Comment:
   I'm curious why this is necessary.



-- 
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