This is an automated email from the ASF dual-hosted git repository. kezhenxu94 pushed a commit to branch test/ci/settings in repository https://gitbox.apache.org/repos/asf/skywalking-java.git
commit 5fdac13f67d78eca85c9357589f4974c9a036c06 Author: kezhenxu94 <kezhenx...@apache.org> AuthorDate: Fri Aug 27 10:11:09 2021 +0800 Fix wrong cache key and clean up CI settings --- .github/actions/{plugins-test => build}/action.yml | 49 +++++++++++++--------- .github/actions/{plugins-test => run}/action.yml | 40 ++++++------------ .github/workflows/ci.yaml | 32 +++++++++----- .github/workflows/codeql.yaml | 4 ++ .github/workflows/plugins-jdk14-test.0.yaml | 27 ++++++++---- .github/workflows/plugins-test.0.yaml | 25 +++++++---- .github/workflows/plugins-test.1.yaml | 25 +++++++---- .github/workflows/plugins-test.2.yaml | 25 +++++++---- .github/workflows/plugins-test.3.yaml | 32 +++++++------- 9 files changed, 155 insertions(+), 104 deletions(-) diff --git a/.github/actions/plugins-test/action.yml b/.github/actions/build/action.yml similarity index 66% copy from .github/actions/plugins-test/action.yml copy to .github/actions/build/action.yml index 3b931b1..12aadee 100644 --- a/.github/actions/plugins-test/action.yml +++ b/.github/actions/build/action.yml @@ -16,12 +16,9 @@ # specific language governing permissions and limitations # under the License. # -name: "Run Plugin Test" -description: "Common steps when running a plugin test" +name: "Build Plugin Agent" +description: "Build Plugin Agent before running a plugin test" inputs: - test_case: - description: "The plugin test name" - required: true java_version: description: "The Java version under which this test case will run" required: false @@ -29,12 +26,6 @@ inputs: runs: using: "composite" steps: - - name: Cache local Maven repository - uses: actions/cache@v2 - with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-agent-test - restore-keys: ${{ runner.os }}-maven-agent-test - name: Check License uses: apache/skywalking-eyes@a63f4afcc287dfb3727ecc45a4afc55a5e69c15f - name: Add checkstyle-plugin @@ -43,25 +34,43 @@ runs: echo "::group::Add checkstyle plugin to the pom.xml" sed -i "/<\/sourceDirectories>/i <sourceDirectory>scenarios\/""${{ inputs.test_case }}""<\/sourceDirectory>" test/plugin/pom.xml echo "::endgroup::" + - name: Cache local Maven repository + uses: actions/cache@v2 + with: + path: ~/.m2/repository + key: ${{ runner.os }}-maven-agent-test + restore-keys: ${{ runner.os }}-maven-agent-test - name: Build SkyWalking Agent shell: bash run: | echo "::group::Build SkyWalking Agent" # Retry one more time due to frequent "maven connection reset" - ./mvnw --batch-mode clean package -DskipTests || \ - ./mvnw --batch-mode clean package -DskipTests + ./mvnw --batch-mode clean package -Dmaven.test.skip || \ + ./mvnw --batch-mode clean package -Dmaven.test.skip echo "::endgroup::" + - uses: actions/upload-artifact@v2 + name: Upload Agent + with: + name: skywalking-agent + path: skywalking-agent - name: Build Docker Image shell: bash run: | echo "::group::Build Docker Image" # Retry one more time due to frequent "maven connection reset" - ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests -P${{ inputs.java_version }} || \ - ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests -P${{ inputs.java_version }} + ./mvnw --batch-mode -f test/plugin/pom.xml clean package -Dmaven.test.skip -P${{ inputs.java_version }} || \ + ./mvnw --batch-mode -f test/plugin/pom.xml clean package -Dmaven.test.skip -P${{ inputs.java_version }} echo "::endgroup::" - - name: Run Plugin Test ${{ inputs.test_case }} - shell: bash - run: | - echo "::group::Run Plugin Test ${{ inputs.test_case }}" - bash test/plugin/run.sh --image_version=${{ inputs.java_version }}-1.0.0 ${{ inputs.test_case }} + + echo "::group::Save Docker Image" + mkdir -p test-containers + docker save -o test-containers/skywalking-agent-test-jvm-${{ inputs.java_version }}-1.0.0.tgz skywalking/agent-test-jvm:${{ inputs.java_version }}-1.0.0 + docker save -o test-containers/skywalking-agent-test-tomcat-${{ inputs.java_version }}-1.0.0.tgz skywalking/agent-test-tomcat:${{ inputs.java_version }}-1.0.0 echo "::endgroup::" + - uses: actions/upload-artifact@v2 + name: Upload Test Containers + with: + name: test-tools + path: | + test-containers + test/plugin/dist/plugin-runner-helper.jar diff --git a/.github/actions/plugins-test/action.yml b/.github/actions/run/action.yml similarity index 52% rename from .github/actions/plugins-test/action.yml rename to .github/actions/run/action.yml index 3b931b1..6265d7e 100644 --- a/.github/actions/plugins-test/action.yml +++ b/.github/actions/run/action.yml @@ -29,36 +29,22 @@ inputs: runs: using: "composite" steps: - - name: Cache local Maven repository - uses: actions/cache@v2 + - uses: actions/download-artifact@v2 with: - path: ~/.m2/repository - key: ${{ runner.os }}-maven-agent-test - restore-keys: ${{ runner.os }}-maven-agent-test - - name: Check License - uses: apache/skywalking-eyes@a63f4afcc287dfb3727ecc45a4afc55a5e69c15f - - name: Add checkstyle-plugin - shell: bash - run: | - echo "::group::Add checkstyle plugin to the pom.xml" - sed -i "/<\/sourceDirectories>/i <sourceDirectory>scenarios\/""${{ inputs.test_case }}""<\/sourceDirectory>" test/plugin/pom.xml - echo "::endgroup::" - - name: Build SkyWalking Agent - shell: bash - run: | - echo "::group::Build SkyWalking Agent" - # Retry one more time due to frequent "maven connection reset" - ./mvnw --batch-mode clean package -DskipTests || \ - ./mvnw --batch-mode clean package -DskipTests - echo "::endgroup::" - - name: Build Docker Image + name: skywalking-agent + path: skywalking-agent + - uses: actions/download-artifact@v2 + with: + name: test-tools + - name: Load Test Containers shell: bash run: | - echo "::group::Build Docker Image" - # Retry one more time due to frequent "maven connection reset" - ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests -P${{ inputs.java_version }} || \ - ./mvnw --batch-mode -f test/plugin/pom.xml clean package -DskipTests -P${{ inputs.java_version }} - echo "::endgroup::" + if ls test-containers/skywalking-agent-test-jvm-${{ inputs.java_version }}-1.0.0.tgz; then + docker load -i test-containers/skywalking-agent-test-jvm-${{ inputs.java_version }}-1.0.0.tgz + fi + if ls test-containers/skywalking-agent-test-tomcat-${{ inputs.java_version }}-1.0.0.tgz; then + docker load -i test-containers/skywalking-agent-test-tomcat-${{ inputs.java_version }}-1.0.0.tgz + fi - name: Run Plugin Test ${{ inputs.test_case }} shell: bash run: | diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 893a4fa..00756ba 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -20,17 +20,34 @@ on: pull_request: schedule: - cron: '0 18 * * *' # TimeZone: UTC 0 + push: + branches: + - test/ci/* concurrency: group: ci-it-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - matrix: - name: ${{ matrix.os }} - ${{ matrix.java-version }} + license: + name: Check License + runs-on: ubuntu-latest + timeout-minutes: 10 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Check License Header + uses: apache/skywalking-eyes@9bd5feb86b5817aa6072b008f9866a2c3bbc8587 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + build: + name: Java ${{ matrix.java-version }} / ${{ matrix.os }} if: (github.event_name == 'schedule' && github.repository == 'apache/skywalking-java') || (github.event_name != 'schedule') runs-on: ${{ matrix.os }}-latest timeout-minutes: 60 + needs: [ license ] strategy: fail-fast: true matrix: @@ -43,17 +60,12 @@ jobs: - uses: actions/checkout@v2 with: submodules: true - - name: Check License Header - if: matrix.os == 'ubuntu' # Container GHA is only supported in Linux system - uses: apache/skywalking-eyes@9bd5feb86b5817aa6072b008f9866a2c3bbc8587 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Cache local Maven repository uses: actions/cache@v2 with: path: ~/.m2/repository - key: ${{ runner.os }}-maven-ci-${{ matrix.os }} - restore-keys: ${{ runner.os }}-maven-${{ matrix.os }} + key: ${{ runner.os }}-maven-ci- + restore-keys: ${{ runner.os }}-maven-ci- - uses: actions/setup-java@v2 with: distribution: adopt @@ -70,6 +82,6 @@ jobs: ci: name: CI runs-on: ubuntu-latest - needs: [ matrix ] + needs: [ build ] steps: - run: echo 'Success' diff --git a/.github/workflows/codeql.yaml b/.github/workflows/codeql.yaml index 6b093f6..10e029e 100644 --- a/.github/workflows/codeql.yaml +++ b/.github/workflows/codeql.yaml @@ -19,8 +19,12 @@ name: "CodeQL" on: push: branches: [ 'main' ] + paths: + - '**/*.java' pull_request: branches: [ 'main' ] + paths: + - '**/*.java' schedule: - cron: '28 3 * * *' diff --git a/.github/workflows/plugins-jdk14-test.0.yaml b/.github/workflows/plugins-jdk14-test.0.yaml index 8e2bcfa..1b23549 100644 --- a/.github/workflows/plugins-jdk14-test.0.yaml +++ b/.github/workflows/plugins-jdk14-test.0.yaml @@ -26,20 +26,29 @@ on: - 'apm-sniffer/**' - 'test/plugin/**' - '**/pom.xml' - - '!test/e2e/**' - - '!apm-webapp/**' - - '!apm-dist/**' - - '!apm-dist-es7/**' - - '!apm-docker/**' - - '!oap-server/**' - '!**.md' + push: + branches: + - test/ci/* concurrency: group: plugins-jdk14-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - PluginsJDK14Test: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build + uses: ./.github/actions/build + + test: + needs: [ build ] name: ${{ matrix.case }} runs-on: ubuntu-latest timeout-minutes: 90 @@ -54,8 +63,8 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 14 - - name: Run Plugin Test - uses: ./.github/actions/plugins-test + - name: Run Test + uses: ./.github/actions/run with: test_case: ${{ matrix.case }} java_version: jdk14 diff --git a/.github/workflows/plugins-test.0.yaml b/.github/workflows/plugins-test.0.yaml index 4cd2335..d211903 100644 --- a/.github/workflows/plugins-test.0.yaml +++ b/.github/workflows/plugins-test.0.yaml @@ -26,20 +26,29 @@ on: - 'apm-sniffer/**' - 'test/plugin/**' - '**/pom.xml' - - '!test/e2e/**' - - '!apm-webapp/**' - - '!apm-dist/**' - - '!apm-dist-es7/**' - - '!apm-docker/**' - - '!oap-server/**' - '!**.md' + push: + branches: + - test/ci/* concurrency: group: plugins-0-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - PluginsTest: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build + uses: ./.github/actions/build + + test: + needs: [ build ] name: ${{ matrix.case }} runs-on: ubuntu-latest timeout-minutes: 90 @@ -83,6 +92,6 @@ jobs: with: java-version: 8 - name: Run Plugin Test - uses: ./.github/actions/plugins-test + uses: ./.github/actions/run with: test_case: ${{ matrix.case }} diff --git a/.github/workflows/plugins-test.1.yaml b/.github/workflows/plugins-test.1.yaml index b63deba..25a9538 100644 --- a/.github/workflows/plugins-test.1.yaml +++ b/.github/workflows/plugins-test.1.yaml @@ -26,20 +26,29 @@ on: - 'apm-sniffer/**' - 'test/plugin/**' - '**/pom.xml' - - '!test/e2e/**' - - '!apm-webapp/**' - - '!apm-dist/**' - - '!apm-dist-es7/**' - - '!apm-docker/**' - - '!oap-server/**' - '!**.md' + push: + branches: + - test/ci/* concurrency: group: plugins-1-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - PluginsTest: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build + uses: ./.github/actions/build + + test: + needs: [ build ] name: ${{ matrix.case }} runs-on: ubuntu-latest timeout-minutes: 90 @@ -75,6 +84,6 @@ jobs: with: java-version: 8 - name: Run Plugin Test - uses: ./.github/actions/plugins-test + uses: ./.github/actions/run with: test_case: ${{ matrix.case }} diff --git a/.github/workflows/plugins-test.2.yaml b/.github/workflows/plugins-test.2.yaml index 96f052f..2ded7f6 100644 --- a/.github/workflows/plugins-test.2.yaml +++ b/.github/workflows/plugins-test.2.yaml @@ -26,20 +26,29 @@ on: - 'apm-sniffer/**' - 'test/plugin/**' - '**/pom.xml' - - '!test/e2e/**' - - '!apm-webapp/**' - - '!apm-dist/**' - - '!apm-dist-es7/**' - - '!apm-docker/**' - - '!oap-server/**' - '!**.md' + push: + branches: + - test/ci/* concurrency: group: plugins-2-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - PluginsTest: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build + uses: ./.github/actions/build + + test: + needs: [ build ] name: ${{ matrix.case }} runs-on: ubuntu-latest timeout-minutes: 90 @@ -77,6 +86,6 @@ jobs: with: java-version: 8 - name: Run Plugin Test - uses: ./.github/actions/plugins-test + uses: ./.github/actions/run with: test_case: ${{ matrix.case }} diff --git a/.github/workflows/plugins-test.3.yaml b/.github/workflows/plugins-test.3.yaml index 8dd1cc4..fc91409 100644 --- a/.github/workflows/plugins-test.3.yaml +++ b/.github/workflows/plugins-test.3.yaml @@ -26,20 +26,29 @@ on: - 'apm-sniffer/**' - 'test/plugin/**' - '**/pom.xml' - - '!test/e2e/**' - - '!apm-webapp/**' - - '!apm-dist/**' - - '!apm-dist-es7/**' - - '!apm-docker/**' - - '!oap-server/**' - '!**.md' + push: + branches: + - test/ci/* concurrency: group: plugins-3-${{ github.event.pull_request.number || github.ref }} cancel-in-progress: true jobs: - PluginsTest: + build: + name: Build + runs-on: ubuntu-latest + timeout-minutes: 30 + steps: + - uses: actions/checkout@v2 + with: + submodules: true + - name: Build + uses: ./.github/actions/build + + test: + needs: [ build ] name: ${{ matrix.case }} runs-on: ubuntu-latest timeout-minutes: 90 @@ -86,11 +95,12 @@ jobs: with: java-version: 8 - name: Run Plugin Test - uses: ./.github/actions/plugins-test + uses: ./.github/actions/run with: test_case: ${{ matrix.case }} Oracle: + needs: [ build ] name: Oracle runs-on: ubuntu-latest timeout-minutes: 90 @@ -101,12 +111,6 @@ jobs: - uses: actions/setup-java@v1 with: java-version: 8 - - name: Add checkstyle-plugin - run: sed -i '/<\/sourceDirectories>/i <sourceDirectory>scenarios\/oracle-scenario<\/sourceDirectory>' test/plugin/pom.xml - - name: Build SkyWalking Agent - run: ./mvnw -q --batch-mode clean package -Dmaven.test.skip - - name: Build Docker image - run: ./mvnw -q --batch-mode -f test/plugin/pom.xml clean package -Dmaven.test.skip - name: Oracle 10.2.0.4.0 run: | curl -O https://skyapm.github.io/ci-assist/jars/ojdbc14-10.2.0.4.0.jar