diff --git a/.github/workflows/lint-llamaindex-fallback.yaml b/.github/workflows/lint-llamaindex-fallback.yaml new file mode 100644 index 0000000000..87a230770a --- /dev/null +++ b/.github/workflows/lint-llamaindex-fallback.yaml @@ -0,0 +1,28 @@ +# Copyright 2024 Google LLC +# +# 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: llamaindex +on: + pull_request: + paths: # These paths are the inverse of lint.yml + - "sdks/llamaindex/**/*.md" + +jobs: + lint: + runs-on: ubuntu-latest + permissions: + contents: none + + steps: + - run: echo "No tests required." \ No newline at end of file diff --git a/.github/workflows/lint-llamaindex.yaml b/.github/workflows/lint-llamaindex.yaml new file mode 100644 index 0000000000..c4414fb33e --- /dev/null +++ b/.github/workflows/lint-llamaindex.yaml @@ -0,0 +1,52 @@ +# Copyright 2024 Google LLC +# +# 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: llamaindex +on: + pull_request: + paths: + - 'sdks/llamaindex/**' + - '!sdks/llamaindex/**/*.md' + +# Declare default permissions as read only. +permissions: read-all + +jobs: + lint: + runs-on: ubuntu-latest + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + steps: + - name: Checkout Repository + uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6 + + - name: Setup Python + uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + with: + python-version: "3.13" + + - name: Install library requirements + run: pip install -r sdks/llamaindex/requirements.txt + + - name: Install test requirements + run: pip install sdks/llamaindex[test] + + - name: Run linters + run: | + black --check . + isort --check . + + - name: Run type-check + run: mypy --install-types --non-interactive --explicit-package-bases sdks/llamaindex \ No newline at end of file diff --git a/sdks/llamaindex/integration.cloudbuild.yaml b/sdks/llamaindex/integration.cloudbuild.yaml new file mode 100644 index 0000000000..0669527d21 --- /dev/null +++ b/sdks/llamaindex/integration.cloudbuild.yaml @@ -0,0 +1,43 @@ +# Copyright 2024 Google LLC +# +# 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. + +steps: + - id: Install library requirements + name: 'python:${_VERSION}' + args: + - install + - '-r' + - 'sdks/llamaindex/requirements.txt' + - '--user' + entrypoint: pip + - id: Install test requirements + name: 'python:${_VERSION}' + args: + - install + - 'sdks/llamaindex[test]' + - '--user' + entrypoint: pip + - id: Run integration tests + name: 'python:${_VERSION}' + env: + - TOOLBOX_URL=$_TOOLBOX_URL + args: + - '-c' + - >- + python -m pytest sdks/llamaindex/tests/ + entrypoint: /bin/bash +options: + logging: CLOUD_LOGGING_ONLY +substitutions: + _VERSION: '3.13' \ No newline at end of file