From e35d02709360db971a07da60e5d9f2d634117f64 Mon Sep 17 00:00:00 2001 From: YouJiacheng <1503679330@qq.com> Date: Wed, 22 Feb 2023 00:06:30 +0800 Subject: [PATCH] Attempt to reuse build in Action --- .github/workflows/api-rest.yml | 6 +- .github/workflows/api-session.yml | 6 +- .github/workflows/capacity-expansion.yml | 6 +- .github/workflows/ds-influxdb.yml | 117 +++++++++++++++-------- .github/workflows/ds-iotdb.yml | 6 +- .github/workflows/ds-parquet.yml | 6 +- .github/workflows/func-transform.yml | 6 +- .github/workflows/func-udf.yml | 6 +- .github/workflows/scale-out.yml | 6 +- .github/workflows/unit-mds.yml | 6 +- 10 files changed, 86 insertions(+), 85 deletions(-) diff --git a/.github/workflows/api-rest.yml b/.github/workflows/api-rest.yml index 99e853048e..dc0401f04d 100644 --- a/.github/workflows/api-rest.yml +++ b/.github/workflows/api-rest.yml @@ -1,10 +1,6 @@ name: "API-Test-RESTful" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/api-session.yml b/.github/workflows/api-session.yml index a55d04f5f9..8d53120573 100644 --- a/.github/workflows/api-session.yml +++ b/.github/workflows/api-session.yml @@ -1,10 +1,6 @@ name: "API-Test-SESSIONv2" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/capacity-expansion.yml b/.github/workflows/capacity-expansion.yml index 2f525fa04c..f1f941748f 100644 --- a/.github/workflows/capacity-expansion.yml +++ b/.github/workflows/capacity-expansion.yml @@ -1,9 +1,5 @@ name: "Capacity-Expansion-Test" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT concurrency: diff --git a/.github/workflows/ds-influxdb.yml b/.github/workflows/ds-influxdb.yml index 4aca343ece..3ac7df36c7 100644 --- a/.github/workflows/ds-influxdb.yml +++ b/.github/workflows/ds-influxdb.yml @@ -13,7 +13,36 @@ concurrency: cancel-in-progress: true jobs: + Build-IGinX-Dev: + strategy: + matrix: + java: [ 8 ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Cache local Maven repository + uses: actions/cache@v3 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} + restore-keys: | + ${{ runner.os }}-maven- + - name: Cache Maven Package Outputs and Intermediates + id: cache-maven-package + uses: actions/cache@v3 + with: + path: /home/runner/work/IGinX/IGinX + key: build-${{ github.run_id }} + - name: Maven Package + if: steps.cache-maven-package.outputs.cache-hit != 'true' + run: mvn clean package -DskipTests + InfluxDB-Capacity-Expansion-ds: + needs: Build-IGinX-Dev strategy: fail-fast: false #max-parallel: 20 @@ -23,18 +52,26 @@ jobs: os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Cache Maven Package Outputs and Intermediates + id: cache-maven-package + uses: actions/cache@v3 + with: + path: /home/runner/work/IGinX/IGinX + key: build-${{ github.run_id }} + - name: Check Cache Hit + if: steps.cache-maven-package.outputs.cache-hit != 'true' + run: exit 1 + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install Python dependencies + - name: Install Python Dependencies run: | python -m pip install --upgrade pip - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - name: Run ZooKeeper run: | if [ "$RUNNER_OS" == "Linux" ]; then @@ -59,8 +96,6 @@ jobs: echo "$RUNNER_OS is not supported" exit 1 fi - - name: Install with Maven - run: mvn clean package -DskipTests - name: Write history Data run: | mvn test -q -Dtest=InfluxDBHistoryDataGeneratorTest -DfailIfNoTests=false @@ -71,6 +106,7 @@ jobs: nohup "${GITHUB_WORKSPACE}/core/target/iginx-core-${VERSION}/sbin/start_iginx.sh" & InfluxDB-SQL-ds: + needs: Build-IGinX-Dev strategy: fail-fast: false #max-parallel: 20 @@ -80,24 +116,26 @@ jobs: os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Cache Maven Package Outputs and Intermediates + id: cache-maven-package + uses: actions/cache@v3 + with: + path: /home/runner/work/IGinX/IGinX + key: build-${{ github.run_id }} + - name: Check Cache Hit + if: steps.cache-maven-package.outputs.cache-hit != 'true' + run: exit 1 + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install Python dependencies + - name: Install Python Dependencies run: | python -m pip install --upgrade pip - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Cache Maven packages - uses: actions/cache@v2.1.5 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - name: Run ZooKeeper run: | if [ "$RUNNER_OS" == "Linux" ]; then @@ -122,8 +160,6 @@ jobs: echo "$RUNNER_OS is not supported" exit 1 fi - - name: Install with Maven - run: mvn clean package -DskipTests - name: Start IginX run: | chmod +x "${GITHUB_WORKSPACE}/core/target/iginx-core-${VERSION}/sbin/start_iginx.sh" @@ -136,6 +172,7 @@ jobs: name: codecov InfluxDB-SQL-SessionPool-ds: + needs: Build-IGinX-Dev strategy: fail-fast: false #max-parallel: 20 @@ -145,24 +182,26 @@ jobs: os: [ ubuntu-latest, macos-latest ] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} + - uses: actions/setup-java@v3 + with: + distribution: 'zulu' + java-version: ${{ matrix.java }} + - name: Cache Maven Package Outputs and Intermediates + id: cache-maven-package + uses: actions/cache@v3 + with: + path: /home/runner/work/IGinX/IGinX + key: build-${{ github.run_id }} + - name: Check Cache Hit + if: steps.cache-maven-package.outputs.cache-hit != 'true' + run: exit 1 + - name: Setup Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} - - name: Install Python dependencies + - name: Install Python Dependencies run: | python -m pip install --upgrade pip - - name: Set up JDK ${{ matrix.java }} - uses: actions/setup-java@v1 - with: - java-version: ${{ matrix.java }} - - name: Cache Maven packages - uses: actions/cache@v2.1.5 - with: - path: ~/.m2 - key: ${{ runner.os }}-m2-${{ hashFiles('/pom.xml') }} - restore-keys: ${{ runner.os }}-m2 - name: Run ZooKeeper run: | if [ "$RUNNER_OS" == "Linux" ]; then @@ -187,8 +226,6 @@ jobs: echo "$RUNNER_OS is not supported" exit 1 fi - - name: Install with Maven - run: mvn clean package -DskipTests - name: Start IginX uses: ./.github/actions/iginxRunner with: @@ -204,7 +241,7 @@ jobs: with: version: ${VERSION} - name: A Lame Integration Test with Maven for SQL - run: mvn test -q -Dtest=InfluxDBSQLSessionPoolIT -DfailIfNoTests=false + run: mvn surefire:test -q -Dtest=InfluxDBSQLSessionPoolIT -DfailIfNoTests=false - uses: codecov/codecov-action@v1 with: file: ./**/target/site/jacoco/jacoco.xml diff --git a/.github/workflows/ds-iotdb.yml b/.github/workflows/ds-iotdb.yml index ad4290ea5e..81d6c5fca2 100644 --- a/.github/workflows/ds-iotdb.yml +++ b/.github/workflows/ds-iotdb.yml @@ -1,10 +1,6 @@ name: "ITTest-ds-IoTDB" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/ds-parquet.yml b/.github/workflows/ds-parquet.yml index 61740a1c00..92c459d41f 100644 --- a/.github/workflows/ds-parquet.yml +++ b/.github/workflows/ds-parquet.yml @@ -1,10 +1,6 @@ name: "ITTest-ds-Parquet" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/func-transform.yml b/.github/workflows/func-transform.yml index ac52471ebe..69cdb5cc87 100644 --- a/.github/workflows/func-transform.yml +++ b/.github/workflows/func-transform.yml @@ -1,10 +1,6 @@ name: "Function-Test-Transform" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/func-udf.yml b/.github/workflows/func-udf.yml index 1f37a2bfe6..a1d44bd156 100644 --- a/.github/workflows/func-udf.yml +++ b/.github/workflows/func-udf.yml @@ -1,10 +1,6 @@ name: "Function-Test-UDF" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/scale-out.yml b/.github/workflows/scale-out.yml index 00e239f22c..3b37d36baf 100644 --- a/.github/workflows/scale-out.yml +++ b/.github/workflows/scale-out.yml @@ -1,9 +1,5 @@ name: "Scale-out-On-IoTDB" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch env: VERSION: 0.6.0-SNAPSHOT diff --git a/.github/workflows/unit-mds.yml b/.github/workflows/unit-mds.yml index bd158d9b0f..e4ae0387ac 100644 --- a/.github/workflows/unit-mds.yml +++ b/.github/workflows/unit-mds.yml @@ -1,10 +1,6 @@ name: "Metadata-Service-Test" -on: - pull_request: - types: [opened, reopened] - branches: - - main +on: workflow_dispatch concurrency: group: ${{ github.workflow }}-${{ github.ref }}