You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/05/05 10:23:18 UTC

[GitHub] [incubator-nuttx-apps] xiaoxiang781216 commented on a change in pull request #230: CI: Simplify flow for checking out repos

xiaoxiang781216 commented on a change in pull request #230:
URL: https://github.com/apache/incubator-nuttx-apps/pull/230#discussion_r420003040



##########
File path: .github/workflows/build.yml
##########
@@ -162,17 +109,38 @@ jobs:
           retry_wait_seconds: 10
           command: docker pull docker.pkg.github.com/apache/incubator-nuttx-testing/nuttx-ci-linux
 
-      - name: Export NuttX Repo SHA
-        run:  echo "::set-env name=nuttx_sha::`git -C sources/nuttx rev-parse HEAD`"
-      - name: Refresh Git Credentials
+      - uses: actions/download-artifact@v2
+        with:
+          name: gitrefs
+          path: gitrefs-rt/
+      - name: Export Repo Refs

Review comment:
       move before "uses: actions/download-artifact@v2"

##########
File path: .github/workflows/build.yml
##########
@@ -162,17 +109,38 @@ jobs:
           retry_wait_seconds: 10
           command: docker pull docker.pkg.github.com/apache/incubator-nuttx-testing/nuttx-ci-linux
 
-      - name: Export NuttX Repo SHA
-        run:  echo "::set-env name=nuttx_sha::`git -C sources/nuttx rev-parse HEAD`"
-      - name: Refresh Git Credentials
+      - uses: actions/download-artifact@v2
+        with:
+          name: gitrefs
+          path: gitrefs-rt/
+      - name: Export Repo Refs
+        run: source gitrefs-rt/gitenv.sh
+
+      - name: Checkout nuttx repo
         uses: actions/checkout@v2
         with:
           repository: apache/incubator-nuttx
-          ref: ${{ env.nuttx_sha }}
+          ref: ${{ env.os_ref }}
           path: sources/nuttx
           fetch-depth: 1
-      - name: Get Tags for NuttX Repo
-        run: git -C sources/nuttx fetch --tags
+      - run: git -C sources/nuttx pull --tags

Review comment:
       Should we use "git -C sources/nuttx fetch --prune --unshallow" to get both branch and tag? I am afraid that we may want the branch at the late time.

##########
File path: .github/workflows/build.yml
##########
@@ -73,52 +73,18 @@ jobs:
                 ;;
             esac
           fi
-
-          echo ::set-output name=os_ref::$OS_REF
-          echo ::set-output name=apps_ref::$APPS_REF
-          echo ::set-output name=testing_ref::$TESTING_REF
-
-      - name: Checkout nuttx repo
-        uses: actions/checkout@v2
-        with:
-          repository: apache/incubator-nuttx
-          ref: ${{ steps.gittargets.outputs.os_ref }}
-          path: sources/nuttx
-          fetch-depth: 1
-
-      - name: Checkout apps repo
-        uses: actions/checkout@v2
+          echo "#!/bin/sh" > gitenv.sh
+          echo "echo ::set-env name=os_ref::$OS_REF" >> gitenv.sh
+          echo "echo ::set-env name=apps_ref::$APPS_REF" >> gitenv.sh
+          echo "echo ::set-env name=testing_ref::$TESTING_REF" >> gitenv.sh
+      - name: Upload gitrefs
+        uses: actions/upload-artifact@v2
         with:
-          repository: apache/incubator-nuttx-apps
-          ref: ${{ steps.gittargets.outputs.apps_ref }}
-          path: sources/apps
-          fetch-depth: 1
-
-      - name: Checkout testing repo
-        uses: actions/checkout@v2
-        with:
-          repository: apache/incubator-nuttx-testing
-          ref: ${{ steps.gittargets.outputs.testing_ref }}
-          path: sources/testing
-          fetch-depth: 1
-
-      - name: Create Source Bundle
-        run: tar -czf sources.tar.gz sources
-      - name: Archive Source Bundle
-        uses: actions/upload-artifact@v1
-        with:
-          name: source-bundle
-          path: sources.tar.gz
-
-      - name: Cache Source
-        id: cache-source
-        uses: actions/cache@v1
-        with:
-          path: sources
-          key: build-sources-${{ github.run_id }}
+          name: gitrefs
+          path: gitenv.sh
 
   Linux:
-    needs: Fetch-Source
+    needs: Compute-Source-Refs

Review comment:
       But Compute-Source-Refs don't generate and upload the cache anymore, why don't we move os_ref/apps_ref/testing_ref into a common function? So we can invoke it in macOS/Linux directly. The current workflow which upload/download gitenv.sh seems too complex.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org