mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 15:37:56 -05:00
Allow selecting architecture for build workflow. (#13113)
Signed-off-by: Satadru Pramanik <satadru@gmail.com>
This commit is contained in:
committed by
GitHub
parent
3d1b946e6d
commit
6ac9bc0a43
43
.github/workflows/Build.yml
vendored
43
.github/workflows/Build.yml
vendored
@@ -32,6 +32,21 @@ on:
|
|||||||
pr_label:
|
pr_label:
|
||||||
description: "PR Label"
|
description: "PR Label"
|
||||||
required: false
|
required: false
|
||||||
|
build-on-i686:
|
||||||
|
description: "Build on i686"
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
build-on-x86_64:
|
||||||
|
description: "Build on x86_64"
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
|
build-on-armv7l:
|
||||||
|
description: "Build on armv7l"
|
||||||
|
default: true
|
||||||
|
type: boolean
|
||||||
|
required: false
|
||||||
env:
|
env:
|
||||||
BRANCH: ${{ inputs.branch || github.ref_name }}
|
BRANCH: ${{ inputs.branch || github.ref_name }}
|
||||||
permissions:
|
permissions:
|
||||||
@@ -68,6 +83,7 @@ jobs:
|
|||||||
i686_packages: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
i686_packages: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
||||||
x86_64_packages: ${{ steps.get-compatibility.outputs.x86_64_PACKAGES }}
|
x86_64_packages: ${{ steps.get-compatibility.outputs.x86_64_PACKAGES }}
|
||||||
armv7l_packages: ${{ steps.get-compatibility.outputs.armv7l_PACKAGES }}
|
armv7l_packages: ${{ steps.get-compatibility.outputs.armv7l_PACKAGES }}
|
||||||
|
matrix: ${{ steps.set-generate-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
@@ -159,10 +175,26 @@ 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
|
||||||
|
id: set-generate-matrix
|
||||||
|
env:
|
||||||
|
i686_PACKAGES: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
||||||
|
x86_64_PACKAGES: ${{ steps.get-compatibility.outputs.x86_64_PACKAGES }}
|
||||||
|
armv7l_PACKAGES: ${{ steps.get-compatibility.outputs.armv7l_PACKAGES }}
|
||||||
|
run: |
|
||||||
|
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||||
|
[[ "${{ ( inputs.build-on-i686) }}" == 'true' ]] && [[ -n "${i686_PACKAGES}" ]] && export CONTAINER_ARCH+=( "\"i686\"" )
|
||||||
|
[[ "${{ ( inputs.build-on-x86_64) }}" == 'true' ]] && [[ -n "${x86_64_PACKAGES}" ]] && export CONTAINER_ARCH+=( "\"x86_64\"" )
|
||||||
|
[[ "${{ ( inputs.build-on-armv7l) }}" == 'true' ]] && [[ -n "${armv7l_PACKAGES}" ]] && export CONTAINER_ARCH+=( "\"armv7l\"" )
|
||||||
|
export ARCHES="$(join_by , "${CONTAINER_ARCH[@]}")"
|
||||||
|
echo "matrix=[${ARCHES}]" >> $GITHUB_OUTPUT
|
||||||
|
echo "matrix=[${ARCHES}]"
|
||||||
generate:
|
generate:
|
||||||
|
needs: setup
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
arch: [i686, x86_64, armv7l]
|
arch: ${{ fromJSON(needs.setup.outputs.matrix) }}
|
||||||
runner:
|
runner:
|
||||||
- ubuntu-24.04
|
- ubuntu-24.04
|
||||||
- ubuntu-24.04-arm
|
- ubuntu-24.04-arm
|
||||||
@@ -174,7 +206,6 @@ jobs:
|
|||||||
- arch: armv7l
|
- arch: armv7l
|
||||||
runner: ubuntu-24.04
|
runner: ubuntu-24.04
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
needs: setup
|
|
||||||
env:
|
env:
|
||||||
CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES: 1
|
CREW_BUILD_NO_PACKAGE_FILE_HASH_UPDATES: 1
|
||||||
CREW_REPO: ${{ github.event.repository.clone_url }}
|
CREW_REPO: ${{ github.event.repository.clone_url }}
|
||||||
@@ -285,6 +316,13 @@ jobs:
|
|||||||
mkdir pkg_cache
|
mkdir pkg_cache
|
||||||
sudo setfacl -R -m u:1000:rwx .
|
sudo setfacl -R -m u:1000:rwx .
|
||||||
# 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
|
||||||
|
echo "CI is not set."
|
||||||
|
else
|
||||||
|
CI_PASSTHROUGH=-e
|
||||||
|
CI_PASSTHROUGH+=" "
|
||||||
|
CI_PASSTHROUGH+=NESTED_CI=${CI}
|
||||||
|
fi
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
--platform "${PLATFORM}" \
|
--platform "${PLATFORM}" \
|
||||||
@@ -297,6 +335,7 @@ jobs:
|
|||||||
-e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \
|
-e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \
|
||||||
-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} \
|
||||||
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
||||||
-v "$(pwd)":/output:rshared \
|
-v "$(pwd)":/output:rshared \
|
||||||
--tmpfs /tmp \
|
--tmpfs /tmp \
|
||||||
|
|||||||
28
.github/workflows/Generate-PR.yml
vendored
28
.github/workflows/Generate-PR.yml
vendored
@@ -63,6 +63,7 @@ jobs:
|
|||||||
i686_packages: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
i686_packages: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
||||||
x86_64_packages: ${{ steps.get-compatibility.outputs.x86_64_PACKAGES }}
|
x86_64_packages: ${{ steps.get-compatibility.outputs.x86_64_PACKAGES }}
|
||||||
armv7l_packages: ${{ steps.get-compatibility.outputs.armv7l_PACKAGES }}
|
armv7l_packages: ${{ steps.get-compatibility.outputs.armv7l_PACKAGES }}
|
||||||
|
matrix: ${{ steps.set-generate-matrix.outputs.matrix }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
@@ -158,11 +159,26 @@ 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
|
||||||
|
id: set-generate-matrix
|
||||||
|
env:
|
||||||
|
i686_PACKAGES: ${{ steps.get-compatibility.outputs.i686_PACKAGES }}
|
||||||
|
x86_64_PACKAGES: ${{ steps.get-compatibility.outputs.x86_64_PACKAGES }}
|
||||||
|
armv7l_PACKAGES: ${{ steps.get-compatibility.outputs.armv7l_PACKAGES }}
|
||||||
|
run: |
|
||||||
|
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||||
|
[[ -n "${i686_PACKAGES}" ]] && export CONTAINER_ARCH+=( "\"i686\"" )
|
||||||
|
# Always run workflow on the x86_64 container as a fallback.
|
||||||
|
export CONTAINER_ARCH+=( "\"x86_64\"" )
|
||||||
|
[[ -n "${armv7l_PACKAGES}" ]] && export CONTAINER_ARCH+=( "\"armv7l\"" )
|
||||||
|
export ARCHES="$(join_by , "${CONTAINER_ARCH[@]}")"
|
||||||
|
echo "matrix=[${ARCHES}]" >> $GITHUB_OUTPUT
|
||||||
|
echo "matrix=[${ARCHES}]"
|
||||||
update-package-files:
|
update-package-files:
|
||||||
strategy:
|
strategy:
|
||||||
max-parallel: 1
|
max-parallel: 1
|
||||||
matrix:
|
matrix:
|
||||||
arch: [i686, x86_64, armv7l]
|
arch: ${{ fromJSON(needs.setup.outputs.matrix) }}
|
||||||
runner:
|
runner:
|
||||||
- ubuntu-24.04
|
- ubuntu-24.04
|
||||||
- ubuntu-24.04-arm
|
- ubuntu-24.04-arm
|
||||||
@@ -288,6 +304,13 @@ jobs:
|
|||||||
mkdir pkg_cache
|
mkdir pkg_cache
|
||||||
sudo setfacl -R -m u:1000:rwx .
|
sudo setfacl -R -m u:1000:rwx .
|
||||||
# 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
|
||||||
|
echo "CI is not set."
|
||||||
|
else
|
||||||
|
CI_PASSTHROUGH=-e
|
||||||
|
CI_PASSTHROUGH+=" "
|
||||||
|
CI_PASSTHROUGH+=NESTED_CI=${CI}
|
||||||
|
fi
|
||||||
docker run \
|
docker run \
|
||||||
--rm \
|
--rm \
|
||||||
--platform "${PLATFORM}" \
|
--platform "${PLATFORM}" \
|
||||||
@@ -300,6 +323,7 @@ jobs:
|
|||||||
-e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \
|
-e CREW_BRANCH="${{ inputs.branch || github.ref_name }}" \
|
||||||
-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} \
|
||||||
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
-v "$(pwd)"/pkg_cache:/usr/local/tmp/packages:rshared \
|
||||||
-v "$(pwd)":/output:rshared \
|
-v "$(pwd)":/output:rshared \
|
||||||
--tmpfs /tmp \
|
--tmpfs /tmp \
|
||||||
@@ -412,7 +436,7 @@ jobs:
|
|||||||
x86_64_PACKAGES: ${{ needs.setup.outputs.x86_64_packages }}
|
x86_64_PACKAGES: ${{ needs.setup.outputs.x86_64_packages }}
|
||||||
armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }}
|
armv7l_PACKAGES: ${{ needs.setup.outputs.armv7l_packages }}
|
||||||
run: |
|
run: |
|
||||||
sudo gem install ptools
|
sudo gem install -N ptools --conservative
|
||||||
function join_by { local IFS="$1"; shift; echo "$*"; }
|
function join_by { local IFS="$1"; shift; echo "$*"; }
|
||||||
rm -rf /tmp/pr.txt
|
rm -rf /tmp/pr.txt
|
||||||
echo -e "## Description" >> /tmp/pr.txt
|
echo -e "## Description" >> /tmp/pr.txt
|
||||||
|
|||||||
Reference in New Issue
Block a user