You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2022/10/31 02:35:02 UTC

[skywalking-infra-e2e] 01/01: Improve GitHub Actions usability and speed by using composite actions' new feature

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

kezhenxu94 pushed a commit to branch gha
in repository https://gitbox.apache.org/repos/asf/skywalking-infra-e2e.git

commit 327c6ff8ea54ace5e28e7f29e9adcde90979b957
Author: kezhenxu94 <ke...@apache.org>
AuthorDate: Fri Oct 28 20:59:50 2022 +0800

    Improve GitHub Actions usability and speed by using composite actions' new feature
---
 action.yaml | 43 +++++++++++++++++++++++++++++++++++--------
 1 file changed, 35 insertions(+), 8 deletions(-)

diff --git a/action.yaml b/action.yaml
index 37dbc01..591ed7e 100644
--- a/action.yaml
+++ b/action.yaml
@@ -24,21 +24,48 @@ inputs:
   log-dir:
     description: The container logs directory
     required: false
-
 runs:
   using: "composite"
   steps:
+    - name: Set up Go 1.18
+      uses: actions/setup-go@v2
+      with:
+        go-version: 1.18
+    - uses: actions/cache@v3
+      if: runner.os == 'Linux'
+      with:
+        path: |
+          ~/.cache/go-build
+          ~/go/pkg/mod
+        key: ${{ runner.os }}-go-${{ hashFiles("$GITHUB_ACTION_PATH/go.sum") }}
+        restore-keys: |
+          ${{ runner.os }}-go-
+    - uses: actions/cache@v3
+      if: runner.os == 'macOS'
+      with:
+        path: |
+          ~/Library/Caches/go-build
+          ~/go/pkg/mod
+        key: ${{ runner.os }}-go-${{ hashFiles("$GITHUB_ACTION_PATH/go.sum") }}
+        restore-keys: |
+          ${{ runner.os }}-go-
+    - uses: actions/cache@v3
+      if: runner.os == 'Windows'
+      with:
+        path: |
+          ~\AppData\Local\go-build
+          ~\go\pkg\mod
+        key: ${{ runner.os }}-go-${{ hashFiles("$GITHUB_ACTION_PATH/go.sum") }}
+        restore-keys: |
+          ${{ runner.os }}-go-
     - shell: bash
-      run: |
-        make -C $GITHUB_ACTION_PATH docker
-        docker run -v $(pwd):/tmp -w /tmp --entrypoint=sh docker.io/apache/e2e:latest -c "cp /usr/local/bin/e2e /tmp/e2e"
-        install ./e2e /usr/local/bin
+      run: make -C $GITHUB_ACTION_PATH install DESTDIR=/usr/local/bin
     - name: E2E Dir Generator
       id: 'e2e-dir-generator'
       shell: bash
       run: |
         WORK_DIR="${{ runner.temp }}/skywalking-infra-e2e"
-        echo "name=work::$WORK_DIR" >> $GITHUB_OUTPUT
+        echo "work=$WORK_DIR" >> $GITHUB_OUTPUT
 
         LOG_DIR=""
         LOG_JOB_DIR=""
@@ -67,8 +94,8 @@ runs:
           LOG_DIR="$WORK_DIR/${{ inputs.log-dir }}"
           LOG_JOB_DIR="$WORK_DIR/${{ inputs.log-dir }}"
         fi
-        echo "name=log::$LOG_DIR" >> $GITHUB_OUTPUT
-        echo "name=log-case::$LOG_JOB_DIR" >> $GITHUB_OUTPUT
+        echo "log=$LOG_DIR" >> $GITHUB_OUTPUT
+        echo "log-case=$LOG_JOB_DIR" >> $GITHUB_OUTPUT
         echo "SW_INFRA_E2E_LOG_DIR=$LOG_DIR" >> $GITHUB_ENV
     - shell: bash
       run: |