-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create LiteRT pre-submit CI to GitHub actions.
LITERT_OSS_REV_ID: 715149733
- Loading branch information
1 parent
35b5a5c
commit 2f76503
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: "presubmit" | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull: | ||
branches: | ||
- main | ||
|
||
permission: | ||
contents: read | ||
actions: write | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
lint_and_typecheck: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- run: python -m pip install pre-commit | ||
- uses: actions/cache@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-${{ env.pythonLocation }}-${{ hashFiles('ci/setup_with_binary.py') }} | ||
- run: pre-commit run --show-diff-on-failure --color=always --all-files | ||
|
||
build: | ||
if: github.repository == 'google-ai-edge/LiteRT' | ||
# ie. presubmit (py 3.11 on ubuntu-latest) | ||
name: "presubmit (py {{ matrix.docker-python-version }} on ubuntu-latest" | ||
strategy: | ||
matrix: | ||
docker-python-version: ['3.9', '3.10', '3.11', '3.12'] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- 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 | ||
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: 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 commit | ||
run: | | ||
export DOCKER_PYTHON_VERSION="${{ matrix.docker-python-version }}" | ||
echo "docker python version: ${DOCKER_PYTHON_VERSION}" | ||
./ci/run_bazel_test_with_docker.sh |