Skip to content

Create LiteRT pre-submit CI to GitHub actions. #46

Create LiteRT pre-submit CI to GitHub actions.

Create LiteRT pre-submit CI to GitHub actions. #46

Workflow file for this run

name: "Presubmit"
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
actions: write
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
# ie. presubmit (py 3.11 on ubuntu-latest)
name: "presubmit (py ${{ matrix.docker-python-version }} on ubuntu-latest"
strategy:
matrix:
docker-python-version: ['3.11']
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Init submodule
run: |
git submodule update --init --recursive
- name: Update submodule by commit
if: ${{ inputs.tensorflow-commit != '' }}
run: |
git submodule update --remote
cd ./third_party/tensorflow
TF_COMMIT="${{ inputs.tensorflow-commit }}"
echo "checking out tensorflow-commit=${TF_COMMIT}"
git checkout -q ${TF_COMMIT}
- name: Test CL
run: |
git rev-parse HEAD
echo "head is at:"
git rev-parse HEAD
cat tflite/python/metrics/metrics_nonportable_test.py
- name: Update submodule with latest
if: ${{ inputs.tensorflow-tag == '' }}
run: |
git submodule update --remote --recursive
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools
python -m pip install build wheel numpy twine auditwheel
python -m pip list
- name: Test PR
run: |
echo "test, we need a pool rather than ubuntu-latest"
exit 0
# export DOCKER_PYTHON_VERSION="${{ matrix.docker-python-version }}"
# export EXPERIMENTAL_TARGETS_ONLY="true"
# echo "docker python version: ${DOCKER_PYTHON_VERSION}"
# ./ci/run_bazel_test_with_docker.sh