[action] add test-fastmodel
authorYelin Jeong <yelini.jeong@samsung.com>
Tue, 6 Dec 2022 01:38:49 +0000 (10:38 +0900)
committer추지호/NPU Lab(SR)/삼성전자 <jiho.chu@samsung.com>
Tue, 20 Dec 2022 04:56:19 +0000 (13:56 +0900)
TAOS-CI's pr-postbuild-fastmodel-apptest is not working now.
It always passed even when build breaks.
This action adds test-fastmodel to pr-build-aarch64.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
.github/actions/test-fastmodel/action.yml [new file with mode: 0644]
.github/workflows/pr-build-aarch64.yml

diff --git a/.github/actions/test-fastmodel/action.yml b/.github/actions/test-fastmodel/action.yml
new file mode 100644 (file)
index 0000000..bb9ed83
--- /dev/null
@@ -0,0 +1,43 @@
+name: test packages
+description: test with fastmodel
+
+inputs:
+  package_path:
+    description: path of RPM packages
+    required: true
+    default: /tmp/rpms
+  run_apptest:
+    description: run apptest
+    required: false
+    type: string
+  art_id:
+    description: artifactory id
+    required: true
+  art_pw:
+    description: artifactory password
+    required: true
+
+runs:
+  using: composite
+  steps:
+    # Move the package
+    - run: |
+        mkdir -p /opt/trinity/share/RPMS
+        cp ${{ inputs.package_path }}/npu-engine* /opt/trinity/share/RPMS
+      shell: bash
+    # Download latest npu kernel
+    - run: |
+        wget -r -np -nH --cut-dirs=5 https://bart.sec.samsung.net/artifactory/aip-generic-local/NPU_LinuxKernel/latest/aarch64/ --user ${{ inputs.art_id }} --password ${{ inputs.art_pw }}
+        mv *.rpm /opt/trinity/share/RPMS
+      shell: bash
+    # Set up test environment
+    - run: |
+        service ssh start
+        service ssh status
+        export ARMLMD_LICENSE_FILE=8224@10.113.242.30
+        su www-data --command /opt/trinity/run_taos &
+        sed -i -e "s/\[IP]/$(hostname -i)/g" /opt/trinity/connect_kernel.exp
+        sed -i -e "s/\[APPTEST]/${{ inputs.run_apptest }}/g" /opt/trinity/connect_kernel.exp
+        sleep 20
+        su www-data --command /opt/trinity/connect_kernel.exp
+      shell: bash
index 1cfa98a81c169f780b53a8015ce4cde5ade5c6a2..6646be572f52db7e6c84a83c8b13335b5a6fae35 100644 (file)
@@ -1,6 +1,7 @@
 name: build package for aarch64
 
 on:
+  push:
   pull_request_target:
     branches: [ tizen ]
 
@@ -9,7 +10,7 @@ jobs:
     # CODE-hosted runner
     runs-on: [ code-large ]
     container:
-      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/bionic:latest
+      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/fastmodel:latest
       # for chroot-based build system
       options: --privileged
       credentials:
@@ -28,3 +29,28 @@ jobs:
         with:
           arch: aarch64
           output_path: /tmp/rpms
+      - name: Fastmodel test
+        uses: ./.github/actions/test-fastmodel
+        with:
+          package_path: /tmp/rpms
+          art_id: ${{ secrets.BART_ID }}
+          art_pw: ${{ secrets.BART_PW }}
+      - name: Upload test result
+        uses: CODE-Actions/upload-artifact@v2
+        with:
+          name: fastmodel test log
+          path: |
+            /opt/trinity/share/log/err.txt
+            /opt/trinity/share/log/out.txt
+      - name: Check if apptest failed
+        run: |
+          echo $(cat /opt/trinity/share/log/result.txt)
+          if [[ "$(cat /opt/trinity/share/log/result.txt)" != 0 ]]; then
+            exit 1
+          fi
+        shell : bash
+      - name: Upload artifacts
+        uses: CODE-Actions/upload-artifact@v2
+        with:
+          name: built-package
+          path: /tmp/rpms