[action] change docker image and runner for gbs build
authorYelin Jeong <yelini.jeong@samsung.com>
Mon, 11 Sep 2023 05:39:02 +0000 (14:39 +0900)
committer추지호/SoC Architecture팀(SR)/삼성전자 <jiho.chu@samsung.com>
Fri, 15 Sep 2023 09:18:08 +0000 (18:18 +0900)
This patch changes docker image for gbs build.
Also, code-linux runner has gbs build issue.

Signed-off-by: Yelin Jeong <yelini.jeong@samsung.com>
.github/actions/build-tizen/action.yml
.github/actions/build-tizen/gbs.conf [new file with mode: 0644]
.github/workflows/pr-build.yml
.github/workflows/release-tizen.yml
.github/workflows/upload-package-tizen.yml

index 0870c1a6ed64ad7e0436c875deca3d0186313977..bab4efaf3c910b3cab7ca0765c30276df5f7ef15 100644 (file)
@@ -14,22 +14,8 @@ inputs:
 runs:
   using: composite
   steps:
-    # copy gbs config
     - run: |
-        cp /root/.gbs.conf .
-      shell: bash
-    # initialize git repository
-    - run: |
-        git config --global user.name "nnsuite"
-        git config --global user.email "nnsuite@samsung.com"
-        git config --global --add safe.directory $PWD
-        git init
-        git add .
-        git commit -a -m "Initialized"
-      shell: bash
-    # run build
-    - run: |
-        gbs build --define "_smp_mflags -j$(nproc)" -A ${{ inputs.arch }}
+        gbs -c .github/actions/build-tizen/gbs.conf build --define "_smp_mflags -j$(nproc)" -A ${{ inputs.arch }}
       shell: bash
     # copy package
     - run: |
diff --git a/.github/actions/build-tizen/gbs.conf b/.github/actions/build-tizen/gbs.conf
new file mode 100644 (file)
index 0000000..c602bce
--- /dev/null
@@ -0,0 +1,16 @@
+[general]
+profile = profile.tizen
+tmpdir = /var/tmp
+editor = vim
+packaging_branch = tizen
+workdir = .
+
+[profile.tizen]
+repos = repo.base, repo.unified
+buildroot = ~/GBS-ROOT/
+
+[repo.base]
+url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Base/reference/repos/standard/packages/
+
+[repo.unified]
+url = http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/reference/repos/standard/packages/
index 3956b4e2026731728c2422030fbbf8e81d410839..93ef6379ab94a501a2680b8a2579056873f03e1c 100644 (file)
@@ -23,21 +23,20 @@ jobs:
           thread-comments: true
 
   build:
-    # CODE-hosted runner
-    runs-on: [ code-linux, code-large ]
+    runs-on: [ code-extra-large ]
     needs: prebuild
     strategy:
       matrix:
         arch: ['aarch64', 'armv7l', 'x86_64']
     container:
-      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/fastmodel:latest
+      image: actions-docker.bart.sec.samsung.net/docker-gbs-base:latest
       # for chroot-based build system
-      options: --privileged
+      options: --user root --privileged
       credentials:
         username: ${{ secrets.BART_ID }}
         password: ${{ secrets.BART_PW }}
 
-    timeout-minutes: 120
+    timeout-minutes: 30
 
     steps:
       - name: Clone your repository
@@ -49,16 +48,42 @@ jobs:
         with:
           arch: ${{ matrix.arch }}
           output_path: /tmp/rpms
-      - if: matrix.arch == 'aarch64'
-        name: Fastmodel test
+      - name: Upload artifacts
+        uses: CODE-Actions/upload-artifact@v2
+        with:
+          name: built-package-${{ matrix.arch }}
+          path: /tmp/rpms
+
+  test:
+    runs-on: [ code-linux, code-large ]
+    needs: build
+    container:
+      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/fastmodel:latest
+      # for chroot-based build system
+      options: --privileged
+      credentials:
+        username: ${{ secrets.BART_ID }}
+        password: ${{ secrets.BART_PW }}
+
+    timeout-minutes: 120
+    steps:
+      - name: Clone your repository
+        uses: CODE-Actions/checkout@v2
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
+      - name: Download rpms
+        uses: CODE-Actions/download-artifact@v3
+        with:
+          name: built-package-aarch64
+          path: /tmp/rpms
+      - name: Fastmodel test
         uses: ./.github/actions/test-fastmodel
         with:
           package_path: /tmp/rpms
           test_type: apptest
           art_id: ${{ secrets.BART_ID }}
           art_pw: ${{ secrets.BART_PW }}
-      - if: matrix.arch == 'aarch64'
-        name: Upload test result
+      - name: Upload test result
         uses: CODE-Actions/upload-artifact@v2
         with:
           name: fastmodel test log
@@ -66,13 +91,7 @@ jobs:
             /opt/trinity/share/log/err.txt
             /opt/trinity/share/log/out.txt
             /opt/trinity/share/log/result.txt
-      - name: Upload artifacts
-        uses: CODE-Actions/upload-artifact@v2
-        with:
-          name: built-package
-          path: /tmp/rpms
-      - if: matrix.arch == 'aarch64'
-        name: Check if apptest failed
+      - name: Check if apptest failed
         run: |
           echo $(cat /opt/trinity/share/log/result.txt)
           if [[ "$(cat /opt/trinity/share/log/result.txt)" != 0 ]]; then
index 5f665b1ff141a0edf17042f7fec581747b57863b..7d709356bce042270a1b4ee9f68afea255e647f5 100644 (file)
@@ -10,14 +10,14 @@ env:
 
 jobs:
   build-and-release-tizen:
-    runs-on: [ code-linux, code-large ]
+    runs-on: [ code-extra-large ]
     strategy:
       matrix:
         arch: ['aarch64', 'armv7l', 'x86_64']
     container:
-      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/bionic:latest
+      image: actions-docker.bart.sec.samsung.net/docker-gbs-base:latest
       # for chroot-based build system
-      options: --privileged
+      options: --user root --privileged
       credentials:
         username: ${{ secrets.BART_ID }}
         password: ${{ secrets.BART_PW }}
@@ -38,7 +38,7 @@ jobs:
       - name: Upload artifacts
         uses: CODE-Actions/upload-artifact@v2
         with:
-          name: built-package-${{ steps.date.outputs.date }}
+          name: built-package-${{ steps.date.outputs.date }}-${{ matrix.arch }}
           path: /tmp/rpms
       - name: Upload to artifactory
         run: |
index 5fe2c2d70328819a94ab20a49cb79344a6e3fcbf..0a829c95b511e99b3e1dafb586fc29db3548aa4c 100644 (file)
@@ -15,15 +15,15 @@ env:
   BART_PW: ${{ secrets.BART_PW }}
 
 jobs:
-  build-and-upload:
-    runs-on: [ code-linux, code-large ]
+  build:
+    runs-on: [ code-extra-large ]
     strategy:
       matrix:
         arch: ['aarch64', 'armv7l', 'x86_64']
     container:
-      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/fastmodel:latest
+      image: actions-docker.bart.sec.samsung.net/docker-gbs-base:latest
       # for chroot-based build system
-      options: --privileged
+      options: --user root --privileged
       credentials:
         username: ${{ secrets.BART_ID }}
         password: ${{ secrets.BART_PW }}
@@ -41,27 +41,10 @@ jobs:
         with:
           arch: ${{ matrix.arch }}
           output_path: /tmp/rpms
-      - if: matrix.arch == 'aarch64'
-        name: Fastmodel test
-        uses: ./.github/actions/test-fastmodel
-        with:
-          package_path: /tmp/rpms
-          test_type: apptest-bulk
-          art_id: ${{ secrets.BART_ID }}
-          art_pw: ${{ secrets.BART_PW }}
-      - if: matrix.arch == 'aarch64'
-        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
-            /opt/trinity/share/log/result.txt
       - name: Upload artifacts
         uses: CODE-Actions/upload-artifact@v2
         with:
-          name: built-package-${{ steps.date.outputs.date }}
+          name: built-package-${{ steps.date.outputs.date }}-${{ matrix.arch }}
           path: /tmp/rpms
       - name: Upload to artifactory
         uses: ./.github/actions/upload-artifacts
@@ -79,3 +62,52 @@ jobs:
           art_repo: $BART_REPO/latest/${{ matrix.arch }}
           art_id: $BART_ID
           art_pw: $BART_PW
+
+  test:
+    runs-on: [ code-linux, code-large ]
+    needs: build
+    container:
+      image: aip-docker-local.bart.sec.samsung.net/n2s2_docker/fastmodel:latest
+      # for chroot-based build system
+      options: --privileged
+      credentials:
+        username: ${{ secrets.BART_ID }}
+        password: ${{ secrets.BART_PW }}
+
+    timeout-minutes: 120
+    steps:
+
+      - name: Get current date
+        id: date
+        run: echo "::set-output name=date::$(date +'%Y%m%d')"
+      - name: Clone your repository
+        uses: CODE-Actions/checkout@v2
+        with:
+          ref: ${{ github.event.pull_request.head.sha }}
+      - name: Download rpms
+        uses: CODE-Actions/download-artifact@v3
+        with:
+          name: built-package-${{ steps.date.outputs.date }}-aarch64
+          path: /tmp/rpms
+      - name: Fastmodel test
+        uses: ./.github/actions/test-fastmodel
+        with:
+          package_path: /tmp/rpms
+          test_type: apptest-bulk
+          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
+            /opt/trinity/share/log/result.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