Skip to content

Patch Riegeli build script in GHA workflow to fix build failure. #22

Patch Riegeli build script in GHA workflow to fix build failure.

Patch Riegeli build script in GHA workflow to fix build failure. #22

Workflow file for this run

# Copyright 2026 DeepMind Technologies Limited..
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
git-ref:
description: Git Ref (Optional)
required: false
jobs:
build:
runs-on: ubuntu-latest
env:
TEST_TMPDIR: '/tmp'
USE_BAZEL_VERSION: 8.2.1
strategy:
matrix:
python-version: ["3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
set -x
pip install --upgrade pip setuptools wheel
# Build and install Riegeli from source
git clone --depth=1 https://github.com/google/riegeli.git /tmp/riegeli
cd /tmp/riegeli
if [ -f configure ]; then ./configure; fi
# Disable TensorFlow support in Riegeli python build to avoid local_config_tf errors
rm -rf python/riegeli/tensorflow
sed -i '/riegeli_dataset_ops/d' python/BUILD
sed -i 's|cd bazel-bin/python/build_pip_package.runfiles/com_google_riegeli/python|if [ -d bazel-bin/python/build_pip_package.runfiles/_main/python ]; then cd bazel-bin/python/build_pip_package.runfiles/_main/python; else cd bazel-bin/python/build_pip_package.runfiles/com_google_riegeli/python; fi|' python/build_pip_package.sh
grep "_main" python/build_pip_package.sh || { echo "Patch failed!"; exit 1; }
bazel build -c opt --@rules_python//python/config_settings:python_version=${{ matrix.python-version }} python:build_pip_package
./bazel-bin/python/build_pip_package --dest /tmp/riegeli_dist --bdist || { ls -R bazel-bin/python/build_pip_package.runfiles; exit 1; }
pip install /tmp/riegeli_dist/*.whl
# Go back to project root and install envlogger
cd $GITHUB_WORKSPACE
pip install .[tfds]
- name: Run tests
run: |
# Find all Python test files (excluding Bazel-only cross-language tests),
# print their names and execute them in parallel with a maximum of 20 processes.
find envlogger -type f -name "*_test.py" ! -path "*/cross_language_test/*" -print0 | xargs -t -0 -n1 -P 20 python3