Skip to content

ci: Resolve Zizmor static security audit findings in workflows and co… #66

ci: Resolve Zizmor static security audit findings in workflows and co…

ci: Resolve Zizmor static security audit findings in workflows and co… #66

Workflow file for this run

name: Test ml-metadata with Conda
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
persist-credentials: false
- name: Setup Micromamba
uses: mamba-org/setup-micromamba@4b9113af4fba0e9e1124b252dd6497a419e7396d # v1.11.0
with:
environment-file: ${{ matrix.os == 'macos-latest' && 'ci/environment-macos.yml' || 'ci/environment.yml' }}
cache-environment: true
create-args: >-
python=${{ matrix.python-version }}
- name: Display environment info
shell: bash -l {0}
run: |
micromamba info
micromamba list
- name: Install Bazel
shell: bash -l {0}
run: |
# Install Bazelisk (manages Bazel versions)
ARCH="amd64"
if [ "$(uname -m)" == "arm64" ]; then
ARCH="arm64"
fi
mkdir -p "$HOME/.local/bin"
if [ "$RUNNER_OS" == "Linux" ]; then
curl -Lo "$HOME/.local/bin/bazel" "https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-linux-${ARCH}"
elif [ "$RUNNER_OS" == "macOS" ]; then
curl -Lo "$HOME/.local/bin/bazel" "https://github.com/bazelbuild/bazelisk/releases/download/v1.25.0/bazelisk-darwin-${ARCH}"
fi
chmod +x "$HOME/.local/bin/bazel"
if [ -n "$CONDA_PREFIX" ]; then
cp "$HOME/.local/bin/bazel" "$CONDA_PREFIX/bin/bazel"
fi
echo "$HOME/.local/bin" >> $GITHUB_PATH
echo "USE_BAZEL_VERSION=7.7.0" >> $GITHUB_ENV
echo "BAZEL_USE_CPP_ONLY_TOOLCHAIN=1" >> $GITHUB_ENV
bazel --version
- name: Build the package
shell: bash -l {0}
run: |
unset APPLE_SDK_VERSION_OVERRIDE XCODE_VERSION_OVERRIDE
rm -rf build build_mlmd_tmp dist
python setup.py bdist_wheel
- name: Install built wheel
shell: bash -l {0}
run: |
pip install dist/*.whl
- name: Run tests
shell: bash -l {0}
run: |
# cleanup (interferes with tests)
rm -rf bazel-*
# run tests
pytest -vv