You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@inlong.apache.org by he...@apache.org on 2022/05/20 00:25:45 UTC

[incubator-inlong] branch master updated: [INLONG-4267][CI] Revert the CI config (#4272)

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

healchow pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong.git


The following commit(s) were added to refs/heads/master by this push:
     new 226e45ab0 [INLONG-4267][CI] Revert the CI config (#4272)
226e45ab0 is described below

commit 226e45ab01ca8bedfa522ca66569dd0ff094e5b7
Author: Yuanhao Ji <ji...@apache.org>
AuthorDate: Fri May 20 08:25:40 2022 +0800

    [INLONG-4267][CI] Revert the CI config (#4272)
---
 .github/workflows/ci_build.yml      | 59 ++++++++++++++++++++++++++++
 .github/workflows/ci_chart_test.yml | 65 +++++++++++++++++++++++++++++++
 .github/workflows/ci_docker.yml     | 76 +++++++++++++++++++++++++++++++++++++
 .github/workflows/ci_ut.yml         | 66 ++++++++++++++++++++++++++++++++
 4 files changed, 266 insertions(+)

diff --git a/.github/workflows/ci_build.yml b/.github/workflows/ci_build.yml
index 0ab21f827..2d1ec3de6 100644
--- a/.github/workflows/ci_build.yml
+++ b/.github/workflows/ci_build.yml
@@ -19,7 +19,38 @@ name: InLong Build
 
 on:
   push:
+    paths:
+      - '.github/workflows/ci_build.yml'
+      - '**/pom.xml'
+      - 'inlong-agent/**'
+      - 'inlong-audit/**'
+      - 'inlong-common/**'
+      - 'inlong-dashboard/**'
+      - 'inlong-dataproxy/**'
+      - 'inlong-distribution/**'
+      - 'inlong-manager/**'
+      - 'inlong-sdk/**'
+      - 'inlong-sort/**'
+      - 'inlong-sort-standalone/**'
+      - 'inlong-tubemq/**'
+      - '!*.md'
+
   pull_request:
+    paths:
+      - '.github/workflows/ci_build.yml'
+      - '**/pom.xml'
+      - 'inlong-agent/**'
+      - 'inlong-audit/**'
+      - 'inlong-common/**'
+      - 'inlong-dashboard/**'
+      - 'inlong-dataproxy/**'
+      - 'inlong-distribution/**'
+      - 'inlong-manager/**'
+      - 'inlong-sdk/**'
+      - 'inlong-sort/**'
+      - 'inlong-sort-standalone/**'
+      - 'inlong-tubemq/**'
+      - '!*.md'
 
 jobs:
   build:
@@ -34,3 +65,31 @@ jobs:
         with:
           java-version: 8
           distribution: adopt
+
+      - name: Cache Maven packages
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.m2/repository
+            !~/.m2/repository/org/apache/inlong
+            !~/.m2/repository/com/github/eirslett
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2
+
+      - name: Build with Maven
+        run: mvn --batch-mode --update-snapshots -e -V clean install -DskipTests
+        env:
+          CI: false
+
+      - name: Get InLong version
+        if: ${{ success() }}
+        run: |
+          version=`mvn -Dexec.executable='echo' -Dexec.args='${project.version}' --non-recursive exec:exec -q`
+          echo "VERSION=${version}" >> $GITHUB_ENV
+
+      - name: Upload binary package
+        if: ${{ success() }}
+        uses: actions/upload-artifact@v3
+        with:
+          name: apache-inlong-${{ env.VERSION }}-bin.tar.gz
+          path: ./inlong-distribution/target/apache-inlong-${{ env.VERSION }}-bin.tar.gz
diff --git a/.github/workflows/ci_chart_test.yml b/.github/workflows/ci_chart_test.yml
index 94fd52fe7..70a2c97e1 100644
--- a/.github/workflows/ci_chart_test.yml
+++ b/.github/workflows/ci_chart_test.yml
@@ -19,15 +19,80 @@ name: InLong Helm Charts Lint and Test
 
 on:
   push:
+    paths:
+      - '.github/workflows/ci_chart_test.yml'
+      - '.github/ct.yml'
+      - '.github/kind.yml'
+      - 'docker/kubernetes/**'
+      - '!docker/kubernetes/NOTES.txt'
+      - '!*.md'
+
   pull_request:
+    paths:
+      - '.github/workflows/ci_chart_test.yml'
+      - '.github/ct.yml'
+      - '.github/kind.yml'
+      - 'docker/kubernetes/**'
+      - '!docker/kubernetes/NOTES.txt'
+      - '!*.md'
+
+env:
+  CT_CONFIG_PATH: '.github/ct.yml'
+  KIND_CONFIG_PATH: '.github/kind.yml'
 
 jobs:
   chart-test:
     name: Lint and test charts
     runs-on: ubuntu-latest
+    strategy:
+      matrix:
+        kubernetes-version:
+          - 'kindest/node:v1.14.10'
+          - 'kindest/node:v1.18.20'
+          - 'kindest/node:v1.21.10'
+          - 'kindest/node:v1.23.4'
     steps:
       - name: Checkout
         uses: actions/checkout@v3
         with:
           fetch-depth: 0
           submodules: true
+
+      - name: Set up Helm
+        uses: azure/setup-helm@v1
+        with:
+          version: v3.5.0
+
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.7
+
+      - name: Set up chart-testing
+        uses: ./.github/actions/chart-testing-action
+
+      - name: List changed charts
+        id: list-changed
+        run: |
+          changed=$(ct list-changed --config ${{ env.CT_CONFIG_PATH }} --target-branch ${{ github.event.repository.default_branch }})
+          if [[ -n "$changed" ]]; then
+            echo "::set-output name=changed::true"
+            echo "Changed charts: $changed"
+          else
+            echo "Charts are not changed, they will not be linted, validated, installed and tested."
+          fi
+
+      # NOTE: If the charts have not changed, they will not be linted, validated, installed and tested.
+      - name: Lint and validate charts
+        run: ct lint --config ${{ env.CT_CONFIG_PATH }}
+
+      - name: Create Kind cluster
+        if: ${{ steps.list-changed.outputs.changed == 'true' }}
+        uses: ./.github/actions/kind-action
+        with:
+          config: ${{ env.KIND_CONFIG_PATH }}
+          node_image: ${{ matrix.kubernetes-version }}
+
+      - name: Install and test charts
+        if: ${{ success() && steps.list-changed.outputs.changed == 'true' }}
+        run: ct install --config ${{ env.CT_CONFIG_PATH }}
diff --git a/.github/workflows/ci_docker.yml b/.github/workflows/ci_docker.yml
index cf8a2926e..9a1cff868 100644
--- a/.github/workflows/ci_docker.yml
+++ b/.github/workflows/ci_docker.yml
@@ -19,7 +19,38 @@ name: InLong Docker Build and Push
 
 on:
   push:
+    paths:
+      - '.github/workflows/ci_docker.yml'
+      - '**/pom.xml'
+      - 'inlong-agent/**'
+      - 'inlong-audit/**'
+      - 'inlong-common/**'
+      - 'inlong-dashboard/**'
+      - 'inlong-dataproxy/**'
+      - 'inlong-distribution/**'
+      - 'inlong-manager/**'
+      - 'inlong-sdk/**'
+      - 'inlong-sort/**'
+      - 'inlong-sort-standalone/**'
+      - 'inlong-tubemq/**'
+      - '!*.md'
+
   pull_request:
+    paths:
+      - '.github/workflows/ci_docker.yml'
+      - '**/pom.xml'
+      - 'inlong-agent/**'
+      - 'inlong-audit/**'
+      - 'inlong-common/**'
+      - 'inlong-dashboard/**'
+      - 'inlong-dataproxy/**'
+      - 'inlong-distribution/**'
+      - 'inlong-manager/**'
+      - 'inlong-sdk/**'
+      - 'inlong-sort/**'
+      - 'inlong-sort-standalone/**'
+      - 'inlong-tubemq/**'
+      - '!*.md'
 
 jobs:
   docker:
@@ -28,3 +59,48 @@ jobs:
     steps:
       - name: Checkout
         uses: actions/checkout@v3
+
+      - name: Set up JDK
+        uses: actions/setup-java@v3
+        with:
+          java-version: 8
+          distribution: adopt
+
+      - name: Set up Python
+        uses: actions/setup-python@v3
+        with:
+          python-version: 3.7
+
+      - name: Cache Maven packages
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.m2/repository
+            !~/.m2/repository/org/apache/inlong
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2
+
+      - name: Build Docker images
+        run: mvn --batch-mode --update-snapshots -e -V clean package -DskipTests -Pdocker
+        env:
+          CI: false
+
+      # If the changes are being pushed to the master branch or a branch like 'release-1.0.0', this step will output true.
+      - name: Match branch
+        id: match-branch
+        if: |
+          success()
+          && github.event_name == 'push'
+          && github.repository_owner == 'apache'
+        run: |
+          if [[ ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} || ${{ github.ref_name }} =~ ^release-[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+              echo "::set-output name=match::true"
+          fi
+
+      - name: Push Docker images to Docker Hub
+        if: ${{ success() && steps.match-branch.outputs.match == 'true' }}
+        working-directory: docker
+        run: bash +x publish.sh
+        env:
+          DOCKER_USER: ${{ secrets.DOCKER_USER }}
+          DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
diff --git a/.github/workflows/ci_ut.yml b/.github/workflows/ci_ut.yml
index 959cda6ca..e3f78a3ca 100644
--- a/.github/workflows/ci_ut.yml
+++ b/.github/workflows/ci_ut.yml
@@ -19,7 +19,38 @@ name: InLong Unit Test
 
 on:
   push:
+    paths:
+      - '.github/workflows/ci_ut.yml'
+      - '**/pom.xml'
+      - 'inlong-agent/**'
+      - 'inlong-audit/**'
+      - 'inlong-common/**'
+      - 'inlong-dashboard/**'
+      - 'inlong-dataproxy/**'
+      - 'inlong-distribution/**'
+      - 'inlong-manager/**'
+      - 'inlong-sdk/**'
+      - 'inlong-sort/**'
+      - 'inlong-sort-standalone/**'
+      - 'inlong-tubemq/**'
+      - '!*.md'
+
   pull_request:
+    paths:
+      - '.github/workflows/ci_ut.yml'
+      - '**/pom.xml'
+      - 'inlong-agent/**'
+      - 'inlong-audit/**'
+      - 'inlong-common/**'
+      - 'inlong-dashboard/**'
+      - 'inlong-dataproxy/**'
+      - 'inlong-distribution/**'
+      - 'inlong-manager/**'
+      - 'inlong-sdk/**'
+      - 'inlong-sort/**'
+      - 'inlong-sort-standalone/**'
+      - 'inlong-tubemq/**'
+      - '!*.md'
 
 jobs:
   unit-test:
@@ -34,3 +65,38 @@ jobs:
         with:
           java-version: 8
           distribution: adopt
+
+      - name: Cache Maven packages
+        uses: actions/cache@v3
+        with:
+          path: |
+            ~/.m2/repository
+            !~/.m2/repository/org/apache/inlong
+          key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
+          restore-keys: ${{ runner.os }}-m2
+
+      - name: Build with Maven
+        run: mvn --batch-mode --update-snapshots -e -V clean install -DskipTests
+        env:
+          CI: false
+
+      - name: Unit test with Maven
+        run: mvn --batch-mode --update-snapshots -e -V test
+        env:
+          CI: false
+
+      - name: Upload unit test results
+        if: ${{ failure() }}
+        uses: actions/upload-artifact@v3
+        with:
+          name: surefire-reports
+          path: ./**/target/surefire-reports/
+          if-no-files-found: ignore
+
+      - name: Upload integration test results
+        if: ${{ failure() }}
+        uses: actions/upload-artifact@v3
+        with:
+          name: failsafe-reports
+          path: ./**/target/failsafe-reports/
+          if-no-files-found: ignore