Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] ci: use treeless clone instead of actions/checkout
@ 2022-12-16 10:02 classabbyamp
  2022-12-16 10:08 ` [PR PATCH] [Updated] " classabbyamp
                   ` (14 more replies)
  0 siblings, 15 replies; 16+ messages in thread
From: classabbyamp @ 2022-12-16 10:02 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 553 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages ci/treeless-clone
https://github.com/void-linux/void-packages/pull/41130

ci: use treeless clone instead of actions/checkout
WIP for now, still testing

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**



A patch file from https://github.com/void-linux/void-packages/pull/41130.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-ci/treeless-clone-41130.patch --]
[-- Type: text/x-diff, Size: 5764 bytes --]

From 84f987672c5a38e2dd889984fb796daafb620c38 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 16 Dec 2022 04:59:55 -0500
Subject: [PATCH 1/3] common/travis: treeless checkout script, clean up
 fetch_upstream

---
 common/travis/checkout.sh       | 11 +++++++++++
 common/travis/fetch_upstream.sh |  5 +----
 2 files changed, 12 insertions(+), 4 deletions(-)
 create mode 100644 common/travis/checkout.sh

diff --git a/common/travis/checkout.sh b/common/travis/checkout.sh
new file mode 100644
index 000000000000..daa7679ba7b7
--- /dev/null
+++ b/common/travis/checkout.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+#
+# checkout.sh
+
+/bin/echo -e '\x1b[32mCloning repository...\x1b[0m'
+# https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/
+git clone --filter=tree:0 ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git
+git checkout ${GITHUB_REF_NAME}
+
+# required by git 2.35.2+
+git config --global --add safe.directory "$PWD"
diff --git a/common/travis/fetch_upstream.sh b/common/travis/fetch_upstream.sh
index e5ec5979493b..0813e0acedbc 100755
--- a/common/travis/fetch_upstream.sh
+++ b/common/travis/fetch_upstream.sh
@@ -1,9 +1,6 @@
 #!/bin/sh
 #
-# changed_templates.sh
-
-# required by git 2.35.2+
-git config --global --add safe.directory "$PWD"
+# fetch_upstream.sh
 
 /bin/echo -e '\x1b[32mFetching upstream...\x1b[0m'
 git fetch --depth 200 https://github.com/void-linux/void-packages.git master

From 02c170a816c979f2e4f75b1848088d9eafb4484f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 16 Dec 2022 05:00:52 -0500
Subject: [PATCH 2/3] .github/workflows: use checkout script instead of action

also fix indentation in cycle check
---
 .github/workflows/build.yaml |  8 ++------
 .github/workflows/cycles.yml | 35 ++++++++++++++++-------------------
 2 files changed, 18 insertions(+), 25 deletions(-)

diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 95f1cd88e338..1fe4db3d0a38 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -26,9 +26,7 @@ jobs:
       LICENSE_LIST: common/travis/license.lst
 
     steps:
-      - uses: actions/checkout@v1
-        with:
-          fetch-depth: 200
+      - run: common/travis/checkout.sh
       - run: common/travis/fetch_upstream.sh
       - run: common/travis/changed_templates.sh
       - run: common/travis/fetch-xbps.sh
@@ -73,11 +71,9 @@ jobs:
           # Upgrade again (in case there was a xbps update)
           xbps-install -yu
 
-      - uses: actions/checkout@v1
-        with:
-          fetch-depth: 200
       - name: Create hostrepo and prepare masterdir
         run: |
+         common/travis/checkout.sh &&
          ln -s "$(pwd)" /hostrepo &&
          common/travis/set_mirror.sh &&
          common/travis/prepare.sh &&
diff --git a/.github/workflows/cycles.yml b/.github/workflows/cycles.yml
index 7d781076dbe9..65bfc2abce47 100644
--- a/.github/workflows/cycles.yml
+++ b/.github/workflows/cycles.yml
@@ -10,7 +10,9 @@ jobs:
     permissions:
       issues: write
     container:
-        image: 'ghcr.io/void-linux/xbps-src-masterdir:20220527RC01-x86_64-musl'
+      image: 'ghcr.io/void-linux/xbps-src-masterdir:20220527RC01-x86_64-musl'
+      env:
+        PATH: '/usr/libexec/chroot-git:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin:/usr/local/bin:/tmp/bin'
     steps:
       - name: Prepare container
         run: |
@@ -23,26 +25,21 @@ jobs:
           xbps-install -yu
           # Install script dependencies
           xbps-install -y python3-networkx github-cli
-      - uses: actions/checkout@v1
-        with:
-          fetch-depth: 1
       - name: Create hostrepo and prepare masterdir
         run: |
-         ln -s "$(pwd)" /hostrepo &&
-         common/travis/set_mirror.sh &&
-         common/travis/prepare.sh
+          common/travis/checkout.sh &&
+          ln -s "$(pwd)" /hostrepo &&
+          common/travis/set_mirror.sh &&
+          common/travis/prepare.sh
       - name: Find cycles and open issues
         run: |
-         PATH="/usr/libexec/chroot-git:$PATH"
-         # required by git 2.35.2+
-         git config --global --add safe.directory "$PWD"
-         common/scripts/xbps-cycles.py | tee cycles
-         grep 'Cycle:' cycles | while read -r line; do
-             if gh issue list -R "$GITHUB_REPOSITORY" -S "$line" | grep .; then
-                 printf "Issue on '%s' already exists.\n" "$line"
-             else
-                 gh issue create -R "$GITHUB_REPOSITORY" -b '' -t "$line"
-             fi
-         done
+          common/scripts/xbps-cycles.py | tee cycles
+          grep 'Cycle:' cycles | while read -r line; do
+              if gh issue list -R "$GITHUB_REPOSITORY" -S "$line" | grep .; then
+                  printf "Issue on '%s' already exists.\n" "$line"
+              else
+                  gh issue create -R "$GITHUB_REPOSITORY" -b '' -t "$line"
+              fi
+          done
         env:
-            GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}
+          GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN }}

From ad3f4c6789cf67a203f6bc92816a7f8dc394121f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Fri, 16 Dec 2022 05:01:46 -0500
Subject: [PATCH 3/3] TEST COMMIT PLS IGNORE

---
 srcpkgs/chezmoi/template | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/srcpkgs/chezmoi/template b/srcpkgs/chezmoi/template
index a2d74b841d70..a74539bb1615 100644
--- a/srcpkgs/chezmoi/template
+++ b/srcpkgs/chezmoi/template
@@ -1,7 +1,7 @@
 # Template file for 'chezmoi'
 pkgname=chezmoi
 version=2.27.3
-revision=1
+revision=2
 build_style=go
 go_import_path="github.com/twpayne/chezmoi/v2"
 go_build_tags="noembeddocs noupgrade"

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-12-21  6:15 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-16 10:02 [PR PATCH] ci: use treeless clone instead of actions/checkout classabbyamp
2022-12-16 10:08 ` [PR PATCH] [Updated] " classabbyamp
2022-12-16 10:14 ` classabbyamp
2022-12-16 10:21 ` classabbyamp
2022-12-16 10:32 ` classabbyamp
2022-12-16 10:36 ` classabbyamp
2022-12-16 10:46 ` classabbyamp
2022-12-16 10:59 ` classabbyamp
2022-12-16 11:02 ` classabbyamp
2022-12-16 11:36 ` classabbyamp
2022-12-16 11:38 ` classabbyamp
2022-12-16 11:42 ` classabbyamp
2022-12-16 11:58 ` classabbyamp
2022-12-16 12:05 ` classabbyamp
2022-12-16 12:25 ` classabbyamp
2022-12-21  6:15 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).