mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
* Sync workflow changes from #13001 Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Attempt to work around disk space issues on GitHub Runners. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * Add changes to Generate PR workflow. Signed-off-by: Satadru Pramanik <satadru@gmail.com> * sync up again. Signed-off-by: Satadru Pramanik <satadru@gmail.com> --------- Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
dd17e8daa0
commit
ed8f069a77
35
.github/workflows/Build.yml
vendored
35
.github/workflows/Build.yml
vendored
@@ -1,6 +1,6 @@
|
|||||||
---
|
---
|
||||||
name: Build
|
name: Build
|
||||||
run-name: Build ${{ inputs.branch || github.ref_name }} by @${{ github.actor }}
|
run-name: Build ${{ inputs.branch || github.ref_name }} for ${{ ( inputs.build-on-i686 ) && ' i686 ' || '' }}${{ ( inputs.build-on-x86_64 ) && ' x86_64 ' || '' }}${{ ( inputs.build-on-armv7l ) && ' armv7l ' || '' }} by @${{ github.actor }}
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
@@ -32,6 +32,11 @@ on:
|
|||||||
pr_label:
|
pr_label:
|
||||||
description: "PR Label"
|
description: "PR Label"
|
||||||
required: false
|
required: false
|
||||||
|
max_build_time:
|
||||||
|
description: "Maximum Build Time (hours)"
|
||||||
|
required: false
|
||||||
|
type: number
|
||||||
|
default: 5.5
|
||||||
build-on-i686:
|
build-on-i686:
|
||||||
description: "Build on i686"
|
description: "Build on i686"
|
||||||
default: true
|
default: true
|
||||||
@@ -175,7 +180,7 @@ jobs:
|
|||||||
echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT"
|
echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT"
|
||||||
echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}"
|
echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}"
|
||||||
fi
|
fi
|
||||||
- name: Create Generate Matrix
|
- name: Generate Creation Matrix
|
||||||
id: set-generate-matrix
|
id: set-generate-matrix
|
||||||
env:
|
env:
|
||||||
i686_PACKAGES: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
i686_PACKAGES: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
||||||
@@ -289,19 +294,26 @@ jobs:
|
|||||||
- name: Run Updater in container
|
- name: Run Updater in container
|
||||||
id: run-updater
|
id: run-updater
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
|
env:
|
||||||
|
CREW_MAX_BUILD_TIME_INPUT: ${{ inputs.max_build_time }}
|
||||||
run: |
|
run: |
|
||||||
|
if [[ -n ${CREW_MAX_BUILD_TIME_INPUT} ]]; then
|
||||||
|
# Convert CREW_MAX_BUILD_TIME_INPUT to seconds.
|
||||||
|
CREW_MAX_BUILD_TIME="$(bc <<<"scale=0;$CREW_MAX_BUILD_TIME_INPUT*3600/1")"
|
||||||
|
echo "Maximum build time is $(bc <<<"scale=0;$CREW_MAX_BUILD_TIME_INPUT*60/1") minutes."
|
||||||
|
fi
|
||||||
[[ -n ${CI} ]] && echo 'CI variable is set.'
|
[[ -n ${CI} ]] && echo 'CI variable is set.'
|
||||||
if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then
|
if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then
|
||||||
# Exit the arm container if there are not armv7l compatible packages.
|
# Exit the arm container if there are not armv7l compatible packages.
|
||||||
echo "Skipping armv7l container builds &/or package file updates"
|
echo "Skipping armv7l container builds &/or package file updates."
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then
|
elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then
|
||||||
# Exit the x86_64 container if there are not x86_64 compatible packages.
|
# Exit the x86_64 container if there are not x86_64 compatible packages.
|
||||||
echo "Skipping x86_64 container builds &/or package file updates"
|
echo "Skipping x86_64 container builds &/or package file updates."
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then
|
elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then
|
||||||
# Exit the i686 container if there are not i686 compatible packages.
|
# Exit the i686 container if there are not i686 compatible packages.
|
||||||
echo "Skipping i686 container builds &/or package file updates"
|
echo "Skipping i686 container builds &/or package file updates."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -313,8 +325,9 @@ jobs:
|
|||||||
# Detection of /output/pkg_cache dir triggers setting
|
# Detection of /output/pkg_cache dir triggers setting
|
||||||
# CREW_CACHE_DIR=1 and CREW_CACHE_ENABLED=1 in the build
|
# CREW_CACHE_DIR=1 and CREW_CACHE_ENABLED=1 in the build
|
||||||
# container. Without these, upload fails.
|
# container. Without these, upload fails.
|
||||||
mkdir pkg_cache
|
mkdir /tmp/pkg_cache
|
||||||
sudo setfacl -R -m u:1000:rwx .
|
sudo setfacl -R -m u:1000:rwx .
|
||||||
|
sudo setfacl -R -m u:1000:rwx /tmp/pkg_cache
|
||||||
# See https://github.com/containerd/containerd/pull/7566#issuecomment-1461134737 for why we set ulimit.
|
# See https://github.com/containerd/containerd/pull/7566#issuecomment-1461134737 for why we set ulimit.
|
||||||
if [ -z ${CI+x} ]; then
|
if [ -z ${CI+x} ]; then
|
||||||
echo "CI is not set."
|
echo "CI is not set."
|
||||||
@@ -323,6 +336,13 @@ jobs:
|
|||||||
CI_PASSTHROUGH+=" "
|
CI_PASSTHROUGH+=" "
|
||||||
CI_PASSTHROUGH+=NESTED_CI=${CI}
|
CI_PASSTHROUGH+=NESTED_CI=${CI}
|
||||||
fi
|
fi
|
||||||
|
if [ -z ${CREW_MAX_BUILD_TIME+x} ]; then
|
||||||
|
echo "CREW_MAX_BUILD_TIME is not set."
|
||||||
|
else
|
||||||
|
CREW_MAX_BUILD_TIME_PASSTHROUGH=-e
|
||||||
|
CREW_MAX_BUILD_TIME_PASSTHROUGH+=" "
|
||||||
|
CREW_MAX_BUILD_TIME_PASSTHROUGH+=CREW_MAX_BUILD_TIME=${CREW_MAX_BUILD_TIME}
|
||||||
|
fi
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
--platform "${PLATFORM}" \
|
--platform "${PLATFORM}" \
|
||||||
@@ -336,7 +356,8 @@ jobs:
|
|||||||
-e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \
|
-e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \
|
||||||
-e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \
|
-e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \
|
||||||
${CI_PASSTHROUGH} \
|
${CI_PASSTHROUGH} \
|
||||||
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
${CREW_MAX_BUILD_TIME_PASSTHROUGH} \
|
||||||
|
-v /tmp/pkg_cache:/usr/local/tmp/packages:rshared \
|
||||||
-v "$(pwd)":/output:rshared \
|
-v "$(pwd)":/output:rshared \
|
||||||
--tmpfs /tmp \
|
--tmpfs /tmp \
|
||||||
--ulimit "nofile=$(ulimit -Sn):$(ulimit -Hn)" \
|
--ulimit "nofile=$(ulimit -Sn):$(ulimit -Hn)" \
|
||||||
|
|||||||
30
.github/workflows/Generate-PR.yml
vendored
30
.github/workflows/Generate-PR.yml
vendored
@@ -28,6 +28,11 @@ on:
|
|||||||
pr_label:
|
pr_label:
|
||||||
description: "PR Label"
|
description: "PR Label"
|
||||||
required: false
|
required: false
|
||||||
|
max_build_time:
|
||||||
|
description: "Maximum Build Time (hours)"
|
||||||
|
required: false
|
||||||
|
type: number
|
||||||
|
default: 5.5
|
||||||
env:
|
env:
|
||||||
BRANCH: ${{ inputs.branch || github.ref_name }}
|
BRANCH: ${{ inputs.branch || github.ref_name }}
|
||||||
permissions:
|
permissions:
|
||||||
@@ -159,7 +164,7 @@ jobs:
|
|||||||
echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT"
|
echo "i686_PACKAGES=${i686_PACKAGES}" >> "$GITHUB_OUTPUT"
|
||||||
echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}"
|
echo "Branch ${{ inputs.branch || github.ref_name }} has these i686 compatible packages: ${i686_PACKAGES}"
|
||||||
fi
|
fi
|
||||||
- name: Create Generate Matrix
|
- name: Generate Creation Matrix
|
||||||
id: set-generate-matrix
|
id: set-generate-matrix
|
||||||
env:
|
env:
|
||||||
i686_PACKAGES: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
i686_PACKAGES: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
||||||
@@ -275,9 +280,15 @@ jobs:
|
|||||||
id: run-updater
|
id: run-updater
|
||||||
if: ${{ ( inputs.update_package_files ) && ( contains(needs.*.result, 'failure') || !cancelled() ) }}
|
if: ${{ ( inputs.update_package_files ) && ( contains(needs.*.result, 'failure') || !cancelled() ) }}
|
||||||
env:
|
env:
|
||||||
|
CREW_MAX_BUILD_TIME_INPUT: ${{ inputs.max_build_time }}
|
||||||
UPDATE_PACKAGE_FILES: ${{ github.event.inputs.update_package_files }}
|
UPDATE_PACKAGE_FILES: ${{ github.event.inputs.update_package_files }}
|
||||||
run: |
|
run: |
|
||||||
[[ "$UPDATE_PACKAGE_FILES" == 'false' ]] && exit 0
|
[[ "$UPDATE_PACKAGE_FILES" == 'false' ]] && exit 0
|
||||||
|
if [[ -n ${CREW_MAX_BUILD_TIME_INPUT} ]]; then
|
||||||
|
# Convert CREW_MAX_BUILD_TIME_INPUT to seconds.
|
||||||
|
CREW_MAX_BUILD_TIME="$(bc <<<"scale=0;$CREW_MAX_BUILD_TIME_INPUT*3600/1")"
|
||||||
|
echo "Maximum build time is $(bc <<<"scale=0;$CREW_MAX_BUILD_TIME_INPUT*60/1") minutes."
|
||||||
|
fi
|
||||||
[[ -n ${CI} ]] && echo 'CI variable is set.'
|
[[ -n ${CI} ]] && echo 'CI variable is set.'
|
||||||
if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then
|
if [ "$PLATFORM" == 'linux/arm/v7' ] && [ -z "${armv7l_PACKAGES}" ]; then
|
||||||
# Exit the arm container if there are not armv7l compatible packages.
|
# Exit the arm container if there are not armv7l compatible packages.
|
||||||
@@ -285,11 +296,11 @@ jobs:
|
|||||||
exit 0
|
exit 0
|
||||||
elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then
|
elif [ "$PLATFORM" == 'linux/amd64' ] && [ -z "${x86_64_PACKAGES}" ]; then
|
||||||
# Exit the x86_64 container if there are not x86_64 compatible packages.
|
# Exit the x86_64 container if there are not x86_64 compatible packages.
|
||||||
echo "Skipping x86_64 container builds &/or package file updates"
|
echo "Skipping x86_64 container builds &/or package file updates."
|
||||||
exit 0
|
exit 0
|
||||||
elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then
|
elif [ "$PLATFORM" == 'linux/386' ] && [ -z "${i686_PACKAGES}" ]; then
|
||||||
# Exit the i686 container if there are not i686 compatible packages.
|
# Exit the i686 container if there are not i686 compatible packages.
|
||||||
echo "Skipping i686 container builds &/or package file updates"
|
echo "Skipping i686 container builds &/or package file updates."
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -301,8 +312,9 @@ jobs:
|
|||||||
# Detection of /output/pkg_cache dir triggers setting
|
# Detection of /output/pkg_cache dir triggers setting
|
||||||
# CREW_CACHE_DIR=1 and CREW_CACHE_ENABLED=1 in the build
|
# CREW_CACHE_DIR=1 and CREW_CACHE_ENABLED=1 in the build
|
||||||
# container. Without these, upload fails.
|
# container. Without these, upload fails.
|
||||||
mkdir pkg_cache
|
mkdir /tmp/pkg_cache
|
||||||
sudo setfacl -R -m u:1000:rwx .
|
sudo setfacl -R -m u:1000:rwx .
|
||||||
|
sudo setfacl -R -m u:1000:rwx /tmp/pkg_cache
|
||||||
# See https://github.com/containerd/containerd/pull/7566#issuecomment-1461134737 for why we set ulimit.
|
# See https://github.com/containerd/containerd/pull/7566#issuecomment-1461134737 for why we set ulimit.
|
||||||
if [ -z ${CI+x} ]; then
|
if [ -z ${CI+x} ]; then
|
||||||
echo "CI is not set."
|
echo "CI is not set."
|
||||||
@@ -311,6 +323,13 @@ jobs:
|
|||||||
CI_PASSTHROUGH+=" "
|
CI_PASSTHROUGH+=" "
|
||||||
CI_PASSTHROUGH+=NESTED_CI=${CI}
|
CI_PASSTHROUGH+=NESTED_CI=${CI}
|
||||||
fi
|
fi
|
||||||
|
if [ -z ${CREW_MAX_BUILD_TIME+x} ]; then
|
||||||
|
echo "CREW_MAX_BUILD_TIME is not set."
|
||||||
|
else
|
||||||
|
CREW_MAX_BUILD_TIME_PASSTHROUGH=-e
|
||||||
|
CREW_MAX_BUILD_TIME_PASSTHROUGH+=" "
|
||||||
|
CREW_MAX_BUILD_TIME_PASSTHROUGH+=CREW_MAX_BUILD_TIME=${CREW_MAX_BUILD_TIME}
|
||||||
|
fi
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
--platform "${PLATFORM}" \
|
--platform "${PLATFORM}" \
|
||||||
@@ -324,7 +343,8 @@ jobs:
|
|||||||
-e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \
|
-e GITLAB_TOKEN="${{ secrets.GITLAB_TOKEN }}" \
|
||||||
-e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \
|
-e GITLAB_TOKEN_USERNAME="${{ secrets.GITLAB_TOKEN_USERNAME }}" \
|
||||||
${CI_PASSTHROUGH} \
|
${CI_PASSTHROUGH} \
|
||||||
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
${CREW_MAX_BUILD_TIME_PASSTHROUGH} \
|
||||||
|
-v /tmp/pkg_cache:/usr/local/tmp/packages:rshared \
|
||||||
-v "$(pwd)":/output:rshared \
|
-v "$(pwd)":/output:rshared \
|
||||||
--tmpfs /tmp \
|
--tmpfs /tmp \
|
||||||
--ulimit "nofile=$(ulimit -Sn):$(ulimit -Hn)" \
|
--ulimit "nofile=$(ulimit -Sn):$(ulimit -Hn)" \
|
||||||
|
|||||||
Reference in New Issue
Block a user