Explorar o código

ci: optimize heavy ci check order (#1950)

* ci: optimize heavy ci check order

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* seperate licenses check job

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* chore: rename job names

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* trigger build packages on master only

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* fix indent

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* delete build_packages from tests

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* add concurrency groups

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* fix test dep 404 error

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* fix: unzip libwasmedge_rustls.so

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

* rename: run_go_tests -> run_unit_tests

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>

---------

Signed-off-by: xjasonlyu <xjasonlyu@gmail.com>
Jason Lyu hai 1 ano
pai
achega
45c374a75f

+ 3 - 1
.github/workflows/build_packages.yaml

@@ -6,9 +6,11 @@ concurrency:
 
 on:
   workflow_run:
-    workflows: ["Run fvt tests","Run test cases"]
+    workflows: [ "Run fvt tests","Run test cases" ]
     types:
       - completed
+    branches:
+      - master
   release:
     types:
       - published

+ 6 - 2
.github/workflows/commit_message.yaml

@@ -1,4 +1,9 @@
 name: Check commit message
+
+concurrency:
+  group: commit-${{ github.event_name }}-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
   pull_request:
     types:
@@ -8,8 +13,7 @@ on:
       - synchronize
 
 jobs:
-  check-commit-message:
-    name: check_commit_message
+  check_commit_message:
     runs-on: ubuntu-latest
     steps:
       - name: Check Type

+ 19 - 4
.github/workflows/lint.yaml

@@ -1,4 +1,9 @@
 name: Lint
+
+concurrency:
+  group: lint-${{ github.event_name }}-${{ github.ref }}
+  cancel-in-progress: true
+
 on:
   pull_request:
     types: [opened, edited, synchronize, reopened]
@@ -10,12 +15,9 @@ on:
       - '.github/workflows/lint.yaml'
 
 jobs:
-
-  lint:
-    name: Lint
+  check_licenses:
     runs-on: ubuntu-latest
     steps:
-
       - name: Set up Go
         uses: actions/setup-go@v4
         with:
@@ -29,6 +31,19 @@ jobs:
           go install github.com/google/go-licenses@latest
           $(go env GOPATH)/bin/go-licenses check ./... --disallowed_types forbidden,restricted,unknown --ignore modernc.org/mathutil
 
+  golangci_lint:
+    runs-on: ubuntu-latest
+    needs:
+      - check-licenses
+    steps:
+      - name: Set up Go
+        uses: actions/setup-go@v4
+        with:
+          go-version: '1.20'
+
+      - name: Check out code into the Go module directory
+        uses: actions/checkout@v3
+
       - name: Install dependencies
         env:
           DEBIAN_FRONTEND: noninteractive

+ 1 - 7
.github/workflows/run_fvt_tests.yaml

@@ -5,13 +5,7 @@ concurrency:
   cancel-in-progress: true
 
 on:
-  push:
-    tags:
-      - "*"
-  pull_request:
-  release:
-    types:
-      - published
+  workflow_call:
 
 env:
   DEBIAN_FRONTEND: noninteractive

+ 11 - 4
.github/workflows/run_test_case.yaml

@@ -11,12 +11,14 @@ on:
     branches:
       - master
   pull_request:
+    paths-ignore:
+      - "docs/**"
   release:
     types:
       - published
 
 jobs:
-  run_test_case:
+  run_unit_tests:
     runs-on: ubuntu-latest
 
     steps:
@@ -36,9 +38,9 @@ jobs:
       run: |
         curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash > /dev/null
 
-        curl -sSfL -O https://github.com/second-state/wasmedge_rustls_plugin/releases/download/0.1.0/WasmEdge-plugin-wasmedge_rustls-0.1.0-alpha-ubuntu20.04_x86_64.tar
-        tar -xf "WasmEdge-plugin-wasmedge_rustls-0.1.0-alpha-ubuntu20.04_x86_64.tar"
-        mv libwasmedge_rustls.so ~/.wasmedge/plugin/
+        curl -sSfL -O https://github.com/second-state/wasmedge_rustls_plugin/releases/download/0.1.0/wasmedge_rustls_plugin_ubuntu-22.04.zip
+        unzip wasmedge_rustls_plugin_ubuntu-22.04.zip
+        mv target/release/libwasmedge_rustls.so ~/.wasmedge/plugin/
 
         mkdir -p plugins/wasm
         set -e -u -x
@@ -88,3 +90,8 @@ jobs:
       with:
         name: stream.log
         path: log/stream.log
+
+  run_fvt_tests:
+    needs:
+      - run_unit_tests
+    uses: ./.github/workflows/run_fvt_tests.yaml