Files
chromebrew/.github/workflows/Unit-Test.yml
Satadru Pramanik, DO, MPH, MEng 79efa1dfd5 Python => 3.13.0 (#10585)
* Python => 3.13

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix VER variables in const.rb

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* bugfixes

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More plumbing changes...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust py3_pip and py3_setuptools to not error during python3 preinstall.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix hash error

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add no_binaries_needed

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* bugfixes...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add PYO3_USE_ABI3_FORWARD_COMPATIBILITY=1 to pip.rb to fix python 3.13 builds.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add workaround for missing binaries...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update cmake

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add lots of package updates.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add py3_bcrypt, rename asciidoc, add more package builds.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* revert postgresql update

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* final updates?

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update curl

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add curl to essential packages to try to prevent unit test failure on i686.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* updates

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* lint

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* fix accidental change to docker package.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Fiz condition of no new updates leavimg a message with CREW_UNATTENDED set.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* more updates, add missing libabigail binaries

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* rebuild py3_dbus_python

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* add arm build for 5.10 musl_linuxheaders

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add builds for openimageio.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust ruby buildsystem slightly to use cache more, adjust unit tests to properly invoke setarch, add py3_pynacl, update libsodium.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Ruby adjustments...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* unit test adjustments...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* unit test adjustments...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add error message to pip install...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* expand pip error reporting

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* More pip adjustments.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add more pip verbose error reporting.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Add new workaround for pip failure on i686...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Refactor pip again...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* more refactoring...

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Adjust py3_pip version restriction.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* Avoid container jdk dependency in snowflake.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* update trove classifiers.

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* adjust package fxn exit

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

* adjust more jdk deps

Signed-off-by: Satadru Pramanik <satadru@gmail.com>

---------

Signed-off-by: Satadru Pramanik <satadru@gmail.com>
2024-10-12 16:03:50 -05:00

151 lines
8.4 KiB
YAML

---
name: Run Unit Tests on PR
on: workflow_call
jobs:
container_tests:
strategy:
matrix:
arch: [x86_64, armv7l, i686]
runner: [self-hosted, ubuntu-latest]
runs-on: ${{ matrix.runner }}
steps:
- name: Exit quickly if on wrong runner.
id: runner_check
run: |
arch="${{ matrix.arch }}"
runner="${{ matrix.runner }}"
echo "matrix arch is $arch"
echo "matrix runner is $runner"
[[ $arch == 'armv7l' ]] && [[ $runner == 'ubuntu-latest' ]] && export exitquick=1
[[ $arch != 'armv7l' ]] && [[ $runner == 'self-hosted' ]] && export exitquick=1
if [[ -n $exitquick ]]; then
echo "exiting"
echo "skipnext=true" >> $GITHUB_OUTPUT
else
echo "not exiting"
fi
- uses: actions/checkout@v4
if: ( steps.runner_check.outputs.skipnext != 'true' )
- name: Dump github context
if: ( steps.runner_check.outputs.skipnext != 'true' )
run: echo "$GITHUB_CONTEXT"
- name: Get non-pkg changed files
id: non-pkg-changed-files
if: ( steps.runner_check.outputs.skipnext != 'true' )
uses: tj-actions/changed-files@v45
with:
files_ignore: packages/*.rb
- name: Get all changed package files
id: changed-ruby-files
if: ( steps.runner_check.outputs.skipnext != 'true' )
uses: tj-actions/changed-files@v45
with:
files: packages/*.rb
- name: Export variables to github context
if: ( steps.runner_check.outputs.skipnext != 'true' )
run: |
# Convert "packages/foo.rb packages/bar.rb" (from steps.changed-ruby-files.outputs.all_changed_files) into "foo bar"
echo "CHANGED_PACKAGES=$(echo "${{ steps.changed-ruby-files.outputs.all_changed_files }}" | xargs basename -s .rb | xargs)" >> $GITHUB_ENV
echo "NON_PKG_CHANGED_FILES=$(echo "${{ steps.non-pkg-changed-files.outputs.all_changed_files }}" | xargs)" >> $GITHUB_ENV
- name: Determine glibc and architecture package compatibility
if: ( steps.runner_check.outputs.skipnext != 'true' )
run: |
# If a package doesnt have a min_glibc value, or if its below 2.27, add it to GLIBC_227_COMPATIBLE_PACKAGES.
export GLIBC_227_COMPATIBLE_PACKAGES="$(for i in ${CHANGED_PACKAGES} ; do if grep -q min_glibc packages/${i}.rb; then grep min_glibc packages/${i}.rb | tr -d \' | awk '{exit $2 <= 2.27}' || echo ${i} ; else echo ${i} ; fi ; done | xargs -r)"
if [[ -n ${GLIBC_227_COMPATIBLE_PACKAGES} ]]; then
echo "GLIBC_227_COMPATIBLE_PACKAGES=${GLIBC_227_COMPATIBLE_PACKAGES}" >> $GITHUB_ENV
echo "PR #${{ github.event.pull_request.number }} has these possibly Glibc 2.27 compatible packages: ${GLIBC_227_COMPATIBLE_PACKAGES}"
fi
# If a package doesnt have a min_glibc value, or if its below 2.37, add it to GLIBC_237_COMPATIBLE_PACKAGES.
export GLIBC_237_COMPATIBLE_PACKAGES="$(for i in ${CHANGED_PACKAGES} ; do grep min_glibc packages/${i}.rb | tr -d \' | awk '{exit $2 <= 2.37}' || echo ${i} ; done | xargs)"
if [[ -n ${GLIBC_237_COMPATIBLE_PACKAGES} ]]; then
echo "GLIBC_237_COMPATIBLE_PACKAGES=${GLIBC_237_COMPATIBLE_PACKAGES}" >> $GITHUB_ENV
echo "PR #${{ github.event.pull_request.number }} has these possibly Glibc 2.37 compatible packages: ${GLIBC_237_COMPATIBLE_PACKAGES}"
fi
# If a package has a compatibility of 'all' or one that includes 'x86_64', add it to x86_64_PACKAGES.
export x86_64_PACKAGES="$(for i in ${CHANGED_PACKAGES}; do grep -q "[[:space:]]compatibility.*all\|[[:space:]]compatibility.*x86_64" packages/${i}.rb && echo ${i}; done | xargs)"
if [[ -n ${x86_64_PACKAGES} ]]; then
echo "x86_64_PACKAGES=${x86_64_PACKAGES}" >> $GITHUB_ENV
echo "PR #${{ github.event.pull_request.number }} has these x86_64 compatible packages: ${x86_64_PACKAGES}"
fi
## If a package has a compatibility of 'all' or one that includes 'armv7l', add it to ARMV7L_PACKAGES.
export ARMV7L_PACKAGES="$(for i in ${CHANGED_PACKAGES}; do grep -q "[[:space:]]compatibility.*all\|[[:space:]]compatibility.*armv7l" packages/${i}.rb && echo ${i}; done | xargs)"
if [[ -n ${ARMV7L_PACKAGES} ]]; then
echo "ARMV7L_PACKAGES=${ARMV7L_PACKAGES}" >> $GITHUB_ENV
echo "PR #${{ github.event.pull_request.number }} has these armv7l compatible packages: ${ARMV7L_PACKAGES}"
fi
## If a package has a compatibility of 'all' or one that includes 'i686', add it to i686_PACKAGES.
export i686_PACKAGES="$(for i in ${CHANGED_PACKAGES}; do grep -q "[[:space:]]compatibility.*all\|[[:space:]]compatibility.*i686" packages/${i}.rb && echo ${i}; done | xargs)"
if [[ -n ${i686_PACKAGES} ]]; then
echo "i686_PACKAGES=${i686_PACKAGES}" >> $GITHUB_ENV
echo "PR #${{ github.event.pull_request.number }} has these i686 compatible packages: ${i686_PACKAGES}"
fi
- name: Export target docker container to github context
if: ( steps.runner_check.outputs.skipnext != 'true' )
env:
TARGET_ARCH: ${{ matrix.arch }}
run: |
case $TARGET_ARCH in
x86_64)
# Export the x86_64 container depending on whether this PR updates packages with a minimum glibc greater than or equal to 2.37.
if [[ $GLIBC_237_COMPATIBLE_PACKAGES ]]; then
echo "CONTAINER=hatch-x86_64.m128" >> $GITHUB_ENV
else
echo "CONTAINER=nocturne-x86_64.m90" >> $GITHUB_ENV
fi
echo "PLATFORM=linux/amd64" >> $GITHUB_ENV
echo "LIB_SUFFIX=64" >> $GITHUB_ENV
;;
armv7l)
# Export the armv7l container depending on whether this PR updates packages with a minimum glibc greater than or equal to 2.37.
if [[ $GLIBC_237_COMPATIBLE_PACKAGES ]]; then
echo "CONTAINER=strongbad-armv7l.m128" >> $GITHUB_ENV
else
echo "CONTAINER=fievel-armv7l.m91" >> $GITHUB_ENV
fi
echo "PLATFORM=linux/arm/v7" >> $GITHUB_ENV
echo "LIB_SUFFIX=" >> $GITHUB_ENV
;;
i686)
# There is only one i686 container based upon M58 with glibc 2.23.
echo "CONTAINER=alex-i686.m58" >> $GITHUB_ENV
echo "PLATFORM=linux/386" >> $GITHUB_ENV
echo "LIB_SUFFIX=" >> $GITHUB_ENV
;;
esac
- name: Run unit tests
if: ( steps.runner_check.outputs.skipnext != 'true' )
run: |
if [[ -z ${NON_PKG_CHANGED_FILES} ]] && [[ $PLATFORM == 'linux/arm/v7' ]] && [[ -z ${ARMV7L_PACKAGES} ]]; then
# Run the arm container if there are non-package changed files,
# but otherwise do not run the arm container if there are no packages compatible with armv7l.
exit 0
fi
if [[ -z ${NON_PKG_CHANGED_FILES} ]] && [[ $PLATFORM == 'linux/amd64' ]] && [[ -z ${x86_64_PACKAGES} ]]; then
# Run the x86_64 container if there are non-package changed files,
# but otherwise do not run the x86_64 container if there are no packages compatible with x86_64.
exit 0
fi
if [[ -z ${NON_PKG_CHANGED_FILES} ]] && [[ $PLATFORM == 'linux/386' ]] && [[ -z ${i686_PACKAGES} ]]; then
# Run the i686 container if there are non-package changed files,
# but otherwise do not run the i686 container if there are no packages compatible with i686.
exit 0
fi
docker pull --platform $PLATFORM satmandu/crewbuild:$CONTAINER
docker run \
--rm \
--platform $PLATFORM \
--privileged \
-u chronos \
-e CHANGED_PACKAGES="$CHANGED_PACKAGES" \
-e LD_LIBRARY_PATH="/usr/local/lib$LIB_SUFFIX" \
-e GCONV_PATH="/usr/local/lib$LIB_SUFFIX/gconv" \
-e CREW_REPO="${{ github.event.pull_request.head.repo.clone_url }}" \
-e CREW_BRANCH="${{ github.head_ref }}" \
"satmandu/crewbuild:$CONTAINER" \
/bin/chromebrewstart /usr/local/lib/crew/tests/unit_test.sh