aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorclassabbyamp <void@placeviolette.net>2022-12-16 10:00:52 +0000
committerclassabbyamp <5366828+classabbyamp@users.noreply.github.com>2022-12-21 06:15:15 +0000
commit4410de52c128850efdc4b16cb1ec5a4aaa0f42fd (patch)
tree5cf2681e59c7f5d5f58153cdba52b49e95621038 /.github/workflows
parent893af2dd60d4520a12a8dee4d879cb2f5e93066c (diff)
downloadvoid-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.tar
void-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.tar.gz
void-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.tar.bz2
void-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.tar.lz
void-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.tar.xz
void-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.tar.zst
void-packages-4410de52c128850efdc4b16cb1ec5a4aaa0f42fd.zip
.github/workflows: use checkout script instead of action
uses treeless fetches instead of `--depth`. This is not supported by `actions/checkout`, so it was implemented as a short script (staying with `actions/checkout@v1` does not seem like a good idea because of its age, and updating to `actions/checkout@v3` would require adding `libstdc++` to any CI workflows that run in void containers because of node's requirements) see also: https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ this can't be implemented as a script in `common/travis/` because the repo doesn't exist on the runner (yet!) also fix indentation in cycle check
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yaml42
-rw-r--r--.github/workflows/cycles.yml53
2 files changed, 68 insertions, 27 deletions
diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml
index 95f1cd88e33..ddb2c4e78f2 100644
--- a/.github/workflows/build.yaml
+++ b/.github/workflows/build.yaml
@@ -26,10 +26,23 @@ jobs:
LICENSE_LIST: common/travis/license.lst
steps:
- - uses: actions/checkout@v1
- with:
- fetch-depth: 200
- - run: common/travis/fetch_upstream.sh
+ - name: Clone and checkout
+ run: |
+ REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
+ /bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
+ git clone --progress --no-checkout --filter=tree:0 \
+ "${{ github.server_url }}/${{ github.repository }}" "$PWD"
+ git config --global --add gc.auto 0
+ git config --global --add safe.directory "$PWD"
+ echo "::endgroup::"
+ /bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
+ git fetch --prune --progress --filter=tree:0 origin \
+ +refs/heads/*:refs/remotes/origin/* \
+ +${{ github.ref }}:"${REMOTE_REF}"
+ echo "::endgroup::"
+ /bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
+ git checkout --progress --force "${REMOTE_REF}"
+ echo "::endgroup::"
- run: common/travis/changed_templates.sh
- run: common/travis/fetch-xbps.sh
- run: common/travis/fetch-xtools.sh
@@ -73,15 +86,28 @@ jobs:
# Upgrade again (in case there was a xbps update)
xbps-install -yu
- - uses: actions/checkout@v1
- with:
- fetch-depth: 200
+ - name: Clone and checkout
+ run: |
+ REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
+ /bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
+ git clone --progress --no-checkout --filter=tree:0 \
+ "${{ github.server_url }}/${{ github.repository }}" "$PWD"
+ git config --global --add gc.auto 0
+ git config --global --add safe.directory "$PWD"
+ echo "::endgroup::"
+ /bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
+ git fetch --prune --progress --filter=tree:0 origin \
+ +refs/heads/*:refs/remotes/origin/* \
+ +${{ github.ref }}:"${REMOTE_REF}"
+ echo "::endgroup::"
+ /bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
+ git checkout --progress --force "${REMOTE_REF}"
+ echo "::endgroup::"
- name: Create hostrepo and prepare masterdir
run: |
ln -s "$(pwd)" /hostrepo &&
common/travis/set_mirror.sh &&
common/travis/prepare.sh &&
- common/travis/fetch_upstream.sh &&
common/travis/fetch-xtools.sh
- run: common/travis/changed_templates.sh
diff --git a/.github/workflows/cycles.yml b/.github/workflows/cycles.yml
index 7d781076dbe..f0631abc899 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,39 @@ jobs:
xbps-install -yu
# Install script dependencies
xbps-install -y python3-networkx github-cli
- - uses: actions/checkout@v1
- with:
- fetch-depth: 1
+
+ - name: Clone and checkout
+ run: |
+ REMOTE_REF=$(echo ${{ github.ref }} | sed 's;refs/;refs/remotes/;')
+ /bin/echo -e '::group::\x1b[32mCloning repository...\x1b[0m'
+ git clone --progress --no-checkout --filter=tree:0 \
+ "${{ github.server_url }}/${{ github.repository }}" "$PWD"
+ git config --global --add gc.auto 0
+ git config --global --add safe.directory "$PWD"
+ echo "::endgroup::"
+ /bin/echo -e '::group::\x1b[32mFetching repository refs...\x1b[0m'
+ git fetch --prune --progress --filter=tree:0 origin \
+ +refs/heads/*:refs/remotes/origin/* \
+ +${{ github.ref }}:"${REMOTE_REF}"
+ echo "::endgroup::"
+ /bin/echo -e '::group::\x1b[32mChecking out repository...\x1b[0m'
+ git checkout --progress --force "${REMOTE_REF}"
+ echo "::endgroup::"
+
- name: Create hostrepo and prepare masterdir
run: |
- ln -s "$(pwd)" /hostrepo &&
- common/travis/set_mirror.sh &&
- common/travis/prepare.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 }}