Update action script (#556)
author최종헌/MDE Lab(SR)/삼성전자 <j-h.choi@samsung.com>
Thu, 30 May 2024 02:34:09 +0000 (11:34 +0900)
committerj-h.choi <j-h.choi@samsung.com>
Tue, 4 Jun 2024 08:37:58 +0000 (17:37 +0900)
Change-Id: I08a862bc2d647945432e93610a5270788cf554e4

.github/workflows/gbs-build.yml
.github/workflows/launcher-action.yml
script/github-comment.sh [deleted file]
scripts/github-comment.sh [new file with mode: 0755]

index dcca2f31155bbaa1f36e469de72c21b936baac01..485f79430390e9ee763e15ab3591584e8ad506f6 100644 (file)
@@ -4,220 +4,204 @@ on:
   pull_request_target:
     branches:
     - tizen
-    - action
 
 jobs:
-  Tizen_Unified_GBS_Build:
+  Tizen_Unified_armv7l_GBS_Build:
     runs-on: [ code-linux, code-large ]
     container:
       image: actions-docker.bart.sec.samsung.net/docker-gbs-base:ubuntu-20.04
       options: --user root --privileged
     steps:
-      - name: proxy setting
-        uses: code-actions/setup-proxy@main
-        with:
-          location: seoulrnd
-
-      - name: Setup .NET
-        uses: code-actions/setup-dotnet@v1
-        with:
-          dotnet-version: '6.0.310'
-
-      - name: Checkout
-        uses: code-actions/checkout@v3
-
-      - name: Build
-        run: |
-          gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P Tizen-Unified
-        if: success()
-
-      - name: Upload artifacts
-        uses: code-actions/upload-artifact@v3
-        with:
-          name: launcher-rpm-Tizen-Unified-armv7l
-          path: .GBS-ROOT/launcher-Unified/local/repos/Tizen_Unified/armv7l/RPMS/*.rpm
-        if: success()
-
-      - name: Leave comment
-        if: failure()
-        uses: code-actions/github-script@v5
-        with:
-          script: |
-            github.rest.issues.createComment({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              issue_number: context.issue.number,
-              body: 'Please check the build status.'
-            })
-
-  Tizen_Unified_X_RPI4_GBS_Build:
+    - name: Setup .NET
+      uses: code-actions/setup-dotnet@v1
+      with:
+        dotnet-version: '6.0.310'
+
+    - name: Checkout
+      uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
+
+    - name: Build
+      run: |
+        gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P Tizen-Unified
+      if: success()
+
+    - name: Upload artifacts
+      uses: code-actions/upload-artifact@v3
+      with:
+        name: launcher-rpm-Tizen-Unified-armv7l
+        path: .GBS-ROOT/launcher-Unified/local/repos/Tizen_Unified/armv7l/RPMS/*.rpm
+      if: success()
+
+    - name: Leave comment
+      if: failure()
+      uses: code-actions/github-script@v5
+      with:
+        script: |
+          github.rest.issues.createComment({
+            owner: context.repo.owner,
+            repo: context.repo.repo,
+            issue_number: context.issue.number,
+            body: 'Please check the build status of Tizen_Unified_armv7l.'
+          })
+
+  Tizen_Unified_X_armv7l_GBS_Build:
     runs-on: [ code-linux, code-large ]
     container:
       image: actions-docker.bart.sec.samsung.net/docker-gbs-base:ubuntu-20.04
       options: --user root --privileged
     steps:
-      - name: proxy setting
-        uses: code-actions/setup-proxy@main
-        with:
-          location: seoulrnd
-
-      - name: Setup .NET
-        uses: code-actions/setup-dotnet@v1
-        with:
-          dotnet-version: '6.0.310'
-
-      - name: Checkout
-        uses: code-actions/checkout@v3
-
-      - name: Build
-        run: |
-          gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P Tizen-Unified-X
-        if: success()
-
-      - name: Upload artifacts
-        uses: code-actions/upload-artifact@v3
-        with:
-          name: launcher-rpm-Tizen-Unified-X-RPI4-armv7l
-          path: .GBS-ROOT/launcher-Unified-X/local/repos/Tizen_Unified_X/armv7l/RPMS/*.rpm
-        if: success()
-
-      - name: Leave comment
-        if: failure()
-        uses: code-actions/github-script@v5
-        with:
-          script: |
-            github.rest.issues.createComment({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              issue_number: context.issue.number,
-              body: 'Please check the build status.'
-            })
-
-  Tizen_Unified_X_VF2_GBS_Build:
+    - name: Setup .NET
+      uses: code-actions/setup-dotnet@v1
+      with:
+        dotnet-version: '6.0.310'
+
+    - name: Checkout
+      uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
+
+    - name: Build
+      run: |
+        gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P Tizen-Unified-X
+      if: success()
+
+    - name: Upload artifacts
+      uses: code-actions/upload-artifact@v3
+      with:
+        name: launcher-rpm-Tizen-Unified-X-RPI4-armv7l
+        path: .GBS-ROOT/launcher-Unified-X/local/repos/Tizen_Unified_X/armv7l/RPMS/*.rpm
+      if: success()
+
+    - name: Leave comment
+      if: failure()
+      uses: code-actions/github-script@v5
+      with:
+        script: |
+          github.rest.issues.createComment({
+            owner: context.repo.owner,
+            repo: context.repo.repo,
+            issue_number: context.issue.number,
+            body: 'Please check the build status of Tizen_Unified_X_armv7l.'
+          })
+
+  Tizen_Unified_X_riscv64_GBS_Build:
     runs-on: [ code-linux, code-large ]
     container:
       image: actions-docker.bart.sec.samsung.net/docker-gbs-base:ubuntu-20.04
       options: --user root --privileged
     steps:
-      - name: proxy setting
-        uses: code-actions/setup-proxy@main
-        with:
-          location: seoulrnd
-
-      - name: Setup .NET
-        uses: code-actions/setup-dotnet@v1
-        with:
-          dotnet-version: '6.0.310'
-
-      - name: Checkout
-        uses: code-actions/checkout@v3
-
-      - name: Build
-        run: |
-          gbs -c .github/gbs.conf build -A riscv64 --include-all --clean -P Tizen-Unified-X
-        if: success()
-
-      - name: Upload artifacts
-        uses: code-actions/upload-artifact@v3
-        with:
-          name: launcher-rpm-Tizen-Unified-X-VF2-riscv64
-          path: .GBS-ROOT/launcher-Unified-X/local/repos/Tizen_Unified_X/riscv64/RPMS/*.rpm
-        if: success()
-
-      - name: Leave comment
-        if: failure()
-        uses: code-actions/github-script@v5
-        with:
-          script: |
-            github.rest.issues.createComment({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              issue_number: context.issue.number,
-              body: 'Please check the build status.'
-            })
-
-  VD_PontusM_GBS_Build:
+    - name: Setup .NET
+      uses: code-actions/setup-dotnet@v1
+      with:
+        dotnet-version: '6.0.310'
+
+    - name: Checkout
+      uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
+
+    - name: Build
+      run: |
+        gbs -c .github/gbs.conf build -A riscv64 --include-all --clean -P Tizen-Unified-X
+      if: success()
+
+    - name: Upload artifacts
+      uses: code-actions/upload-artifact@v3
+      with:
+        name: launcher-rpm-Tizen-Unified-X-VF2-riscv64
+        path: .GBS-ROOT/launcher-Unified-X/local/repos/Tizen_Unified_X/riscv64/RPMS/*.rpm
+      if: success()
+
+    - name: Leave comment
+      if: failure()
+      uses: code-actions/github-script@v5
+      with:
+        script: |
+          github.rest.issues.createComment({
+            owner: context.repo.owner,
+            repo: context.repo.repo,
+            issue_number: context.issue.number,
+            body: 'Please check the build status of Tizen_Unified_X_riscv64.'
+          })
+
+  VD_PontusM_armv7l_GBS_Build:
     runs-on: [ code-linux, code-large ]
     container:
       image: actions-docker.bart.sec.samsung.net/docker-gbs-base:ubuntu-20.04
       options: --user root --privileged
     steps:
-      - name: proxy setting
-        uses: code-actions/setup-proxy@main
-        with:
-          location: seoulrnd
-
-      - name: Setup .NET
-        uses: code-actions/setup-dotnet@v1
-        with:
-          dotnet-version: '6.0.310'
-
-      - name: Checkout
-        uses: code-actions/checkout@v3
-
-      - name: Build
-        run: |
-          gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P VD-PontusM
-        if: success()
-
-      - name: Upload artifacts
-        uses: code-actions/upload-artifact@v3
-        with:
-          name: launcher-rpm-VD-PontusM-armv7l
-          path: .GBS-ROOT/launcher-PontusM/local/repos/VD_PontusM/armv7l/RPMS/*.rpm
-        if: success()
-
-      - name: Leave comment
-        if: failure()
-        uses: code-actions/github-script@v5
-        with:
-          script: |
-            github.rest.issues.createComment({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              issue_number: context.issue.number,
-              body: 'Please check the build status.'
-            })
-
-#  VD_KantSU2e_build:
+    - name: Setup .NET
+      uses: code-actions/setup-dotnet@v1
+      with:
+        dotnet-version: '6.0.310'
+
+    - name: Checkout
+      uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
+
+    - name: Build
+      run: |
+        gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P VD-PontusM
+      if: success()
+
+    - name: Upload artifacts
+      uses: code-actions/upload-artifact@v3
+      with:
+        name: launcher-rpm-VD-PontusM-armv7l
+        path: .GBS-ROOT/launcher-PontusM/local/repos/VD_PontusM/armv7l/RPMS/*.rpm
+      if: success()
+
+    - name: Leave comment
+      if: failure()
+      uses: code-actions/github-script@v5
+      with:
+        script: |
+          github.rest.issues.createComment({
+            owner: context.repo.owner,
+            repo: context.repo.repo,
+            issue_number: context.issue.number,
+            body: 'Please check the build status of VD_PontusM_armv7l.'
+          })
+
+#  VD_KantSU2e_armv7l_GBS_build:
 #    runs-on: [ code-linux, code-large ]
 #    container:
 #      image: actions-docker.bart.sec.samsung.net/docker-gbs-base:ubuntu-20.04
 #      options: --user root --privileged
 #    steps:
-#      - name: proxy setting
-#        uses: code-actions/setup-proxy@main
-#        with:
-#          location: seoulrnd
-
-#      - name: Setup .NET
-#        uses: code-actions/setup-dotnet@v1
-#        with:
-#          dotnet-version: '6.0.310'
-
-#      - name: Checkout
-#        uses: code-actions/checkout@v3
-
-#      - name: Build
-#        run: |
-#          gbs -c .github/gbs.conf build -A armv7l --include-all -P VD-KantSU2e
-#        if: success()
-
-#      - name: Upload artifacts
-#        uses: code-actions/upload-artifact@v3
-#        with:
-#          name: launcher-rpm-VD-KantSU2e-armv7l
-#          path: .GBS-ROOT/launcher-KantSU2e/local/repos/VD_KantSU2e/armv7l/RPMS/*.rpm
-#        if: success()
+#    - name: Setup .NET
+#      uses: code-actions/setup-dotnet@v1
+#      with:
+#        dotnet-version: '6.0.310'
 
-#      - name: Leave comment
-#        if: failure()
-#        uses: code-actions/github-script@v5
+#    - name: Checkout
+#      uses: code-actions/checkout@v3
 #        with:
-#          script: |
-#            github.rest.issues.createComment({
-#              owner: context.repo.owner,
-#              repo: context.repo.repo,
-#              issue_number: context.issue.number,
-#              body: 'Please check the build status.'
-#            })
+#          ref: refs/pull/${{ github.event.pull_request.number }}/head
+
+#    - name: Build
+#      run: |
+#        gbs -c .github/gbs.conf build -A armv7l --include-all -P VD-KantSU2e
+#      if: success()
+
+#    - name: Upload artifacts
+#      uses: code-actions/upload-artifact@v3
+#      with:
+#        name: launcher-rpm-VD-KantSU2e-armv7l
+#        path: .GBS-ROOT/launcher-KantSU2e/local/repos/VD_KantSU2e/armv7l/RPMS/*.rpm
+#      if: success()
+
+#    - name: Leave comment
+#      if: failure()
+#      uses: code-actions/github-script@v5
+#      with:
+#        script: |
+#          github.rest.issues.createComment({
+#            owner: context.repo.owner,
+#            repo: context.repo.repo,
+#            issue_number: context.issue.number,
+#            body: 'Please check the build status of VD_KantSU2e_armv7l.'
+#          })
index 52bbc69006d64ce7b6d2696ad3967c8514424b5c..1c94c469a615b9c8e5bb82281923d0914f1f3663 100644 (file)
@@ -4,58 +4,56 @@ on:
   pull_request_target:
     branches:
     - tizen
-    - action
 
 jobs:
-  Tizen_Unified_GBS_Build:
+  Tizen_Unified_armv7l_GBS_Build:
     runs-on: [ code-linux, code-large ]
     container:
       image: actions-docker.bart.sec.samsung.net/docker-gbs-base:ubuntu-20.04
       options: --user root --privileged
     steps:
-      - name: proxy setting
-        uses: code-actions/setup-proxy@main
-        with:
-          location: seoulrnd
-
-      - name: Setup .NET
-        uses: code-actions/setup-dotnet@v1
-        with:
-          dotnet-version: '6.0.310'
-
-      - name: Checkout
-        uses: code-actions/checkout@v3
-
-      - name: Build
-        run: |
-          gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P Tizen-Unified
-        if: success()
-
-      - name: Upload artifacts
-        uses: code-actions/upload-artifact@v3
-        with:
-          name: launcher-rpm-Tizen-Unified-armv7l
-          path: .GBS-ROOT/launcher-Unified/local/repos/Tizen_Unified/armv7l/RPMS/*.rpm
-        if: success()
-
-      - name: Leave comment
-        if: failure()
-        uses: code-actions/github-script@v5
-        with:
-          script: |
-            github.rest.issues.createComment({
-              owner: context.repo.owner,
-              repo: context.repo.repo,
-              issue_number: context.issue.number,
-              body: 'Please check the build status.'
-            })
+    - name: Setup .NET
+      uses: code-actions/setup-dotnet@v1
+      with:
+        dotnet-version: '6.0.310'
+
+    - name: Checkout
+      uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
+
+    - name: Build
+      run: |
+        gbs -c .github/gbs.conf build -A armv7l --include-all --clean -P Tizen-Unified
+      if: success()
+
+    - name: Upload artifacts
+      uses: code-actions/upload-artifact@v3
+      with:
+        name: launcher-rpm-Tizen-Unified-armv7l
+        path: .GBS-ROOT/launcher-Unified/local/repos/Tizen_Unified/armv7l/RPMS/*.rpm
+      if: success()
+
+    - name: Leave comment
+      if: failure()
+      uses: code-actions/github-script@v5
+      with:
+        script: |
+          github.rest.issues.createComment({
+            owner: context.repo.owner,
+            repo: context.repo.repo,
+            issue_number: context.issue.number,
+            body: 'Please check the build status.'
+          })
 
   Tizen_Unified_launcher_performance:
     runs-on: [ self-hosted ]
-    needs: Tizen_Unified_GBS_Build
+    needs: Tizen_Unified_armv7l_GBS_Build
     steps:
     - name: Checkout
       uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
 
     - name: Connect RPI4
       shell: bash
@@ -95,8 +93,9 @@ jobs:
       shell: bash
       run: |
         ls ./
-        sdb -d push ./dotnet-launcher-6.0.9-1.armv7l.rpm /root
-        sdb -d shell rpm -Uvh --force /root/dotnet-launcher-6.0.9-1.armv7l.rpm
+        sdb -d shell rm /root/dotnet-launcher-*.rpm
+        sdb -d push ./dotnet-launcher-[0-9]*.armv7l.rpm /root
+        sdb -d shell rpm -Uvh --force /root/dotnet-launcher-[0-9]*.armv7l.rpm
         sdb -d shell "setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet && setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet-loader && setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet-launcher && setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet-hydra-loader"
         sdb -d shell "killall -9 dotnet-loader"
         sleep 30
@@ -151,6 +150,8 @@ jobs:
     steps:
     - name: Checkout
       uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
 
     - name: Build TC
       shell: bash
@@ -179,8 +180,9 @@ jobs:
       shell: bash
       run: |
         ls ./
-        sdb -d push ./dotnet-launcher-6.0.9-1.armv7l.rpm /root
-        sdb -d shell rpm -Uvh --force /root/dotnet-launcher-6.0.9-1.armv7l.rpm
+        sdb -d shell rm /root/dotnet-launcher-*.rpm
+        sdb -d push ./dotnet-launcher-[0-9]*.armv7l.rpm /root
+        sdb -d shell rpm -Uvh --force /root/dotnet-launcher-[0-9]*.armv7l.rpm
         sdb -d shell "setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet && setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet-loader && setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet-launcher && setcap cap_setgid,cap_sys_admin+ei /usr/bin/dotnet-hydra-loader"
         sdb -d shell "killall -9 dotnet-loader"
         sdb -d shell "cat /etc/info.ini" >> ./tests/TCs/device.info
@@ -214,6 +216,8 @@ jobs:
     steps:
     - name: Checkout
       uses: code-actions/checkout@v3
+      with:
+        ref: refs/pull/${{ github.event.pull_request.number }}/head
 
     - name: Connect RPI4
       shell: bash
diff --git a/script/github-comment.sh b/script/github-comment.sh
deleted file mode 100644 (file)
index fb4fba5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-#!/bin/bash
-html_content="$(cat $2)"
-
-json_payload=$(jq -n --arg body "$html_content" '{"body": $body}')
-echo "[GITHUB COMMENT] json_payload --> ${json_payload}"
-
-curl -L \
-    -X POST \
-    -H "Accept: application/vnd.github+json" \
-    -H "Authorization: Bearer $JH_GITHUB_TOKEN" \
-    https://github.sec.samsung.net/api/v3/repos/dotnet/launcher/issues/$1/comments \
-    -d "$json_payload"
-
-exit 0
diff --git a/scripts/github-comment.sh b/scripts/github-comment.sh
new file mode 100755 (executable)
index 0000000..fb4fba5
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/bash
+html_content="$(cat $2)"
+
+json_payload=$(jq -n --arg body "$html_content" '{"body": $body}')
+echo "[GITHUB COMMENT] json_payload --> ${json_payload}"
+
+curl -L \
+    -X POST \
+    -H "Accept: application/vnd.github+json" \
+    -H "Authorization: Bearer $JH_GITHUB_TOKEN" \
+    https://github.sec.samsung.net/api/v3/repos/dotnet/launcher/issues/$1/comments \
+    -d "$json_payload"
+
+exit 0