Browse Source

try running gclient sync

John Kleinschmidt 3 years ago
parent
commit
c31cc93a12
1 changed files with 43 additions and 9 deletions
  1. 43 9
      .github/workflows/github-actions.yml

+ 43 - 9
.github/workflows/github-actions.yml

@@ -1,17 +1,51 @@
 name: GitHub Actions Demo
 on: [push]
 jobs:
-  Explore-GitHub-Actions:
+  osx-testing-x64:
     runs-on:  macos-11-xl
     steps:
-      - run: echo "🎉 The job was automatically triggered by a ${{ github.event_name }} event."
-      - run: echo "🐧 This job is now running on a ${{ runner.os }} server hosted by GitHub!"
-      - run: echo "🔎 The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
-      - name: Check out repository code
+      - name: Check out Electron
         uses: actions/checkout@v2
-      - run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
-      - run: echo "🖥️ The workflow is now ready to test your code on the runner."
-      - name: List files in the repository
+      - name: Get and setup depot tools
         run: |
-          ls ${{ github.workspace }}
+          git clone --depth=1 https://chromium.googlesource.com/chromium/tools/depot_tools.git
+          echo "$PWD/depot_tools" >> $GITHUB_PATH
+      - name: Check amount of disk space available
+        run: df -h
+      - name: Gclient sync
+        run: |
+            gclient config \
+              --name "src/electron" \
+              --unmanaged \
+              "https://github.com/electron/electron"
+            ELECTRON_USE_THREE_WAY_MERGE_FOR_PATCHES=1 gclient sync --with_branch_heads --with_tags
+            if [ "$IS_RELEASE" != "true" ]; then
+              # Re-export all the patches to check if there were changes.
+              python src/electron/script/export_all_patches.py src/electron/patches/config.json
+              cd src/electron
+              git update-index --refresh || true
+              if ! git diff-index --quiet HEAD --; then
+                # There are changes to the patches. Make a git commit with the updated patches
+                git add patches
+                GIT_COMMITTER_NAME="PatchUp" GIT_COMMITTER_EMAIL="73610968+patchup[bot]@users.noreply.github.com" git commit -m "chore: update patches" --author="PatchUp <73610968+patchup[bot]@users.noreply.github.com>"
+                # Export it
+                mkdir -p ../../patches
+                git format-patch -1 --stdout --keep-subject --no-stat --full-index > ../../patches/update-patches.patch
+                if (node ./script/push-patch.js 2> /dev/null > /dev/null); then
+                  echo
+                  echo "======================================================================"
+                  echo "Changes to the patches when applying, we have auto-pushed the diff to the current branch"
+                  echo "A new CI job will kick off shortly"
+                  echo "======================================================================"
+                  exit 1
+                else
+                  echo
+                  echo "======================================================================"
+                  echo "There were changes to the patches when applying."
+                  echo "Check the CI artifacts for a patch you can apply to fix it."
+                  echo "======================================================================"
+                  exit 1
+                fi
+              fi
+            fi   
       - run: echo "🍏 This job's status is ${{ job.status }}."