From 889ac9106ba7904df26e47e4b741d1e4ee24ac4f Mon Sep 17 00:00:00 2001 From: Brett Hoerner Date: Thu, 21 Nov 2024 09:21:20 -0700 Subject: [PATCH] Simple build and push --- .github/CODEOWNERS | 40 ----- .github/ISSUE_TEMPLATE/bug_report.md | 29 ---- .github/ISSUE_TEMPLATE/feature_request.md | 17 -- .github/pull_request_template.md | 10 -- .github/workflows/auto-assign-issues.yml | 40 ----- .github/workflows/docker-build-push.yml | 37 ++++ .github/workflows/docker-build.yml | 55 ------ .github/workflows/docs-generate.yml | 55 ------ .github/workflows/lint-check.yml | 45 ----- .github/workflows/publish-swagger-docs.yml | 32 ---- .github/workflows/python-client-tests.yml | 33 ---- .github/workflows/release-workflow.yml | 25 --- .github/workflows/tarball-gen-tests.yml | 38 ----- .github/workflows/tutorial-tests.yml | 39 ----- .github/workflows/ucai-core-tests.yml | 66 -------- .github/workflows/ucai-integration-tests.yml | 167 ------------------- .github/workflows/ucai-package-build.yml | 62 ------- .github/workflows/unit-tests.yml | 31 ---- 18 files changed, 37 insertions(+), 784 deletions(-) delete mode 100644 .github/CODEOWNERS delete mode 100644 .github/ISSUE_TEMPLATE/bug_report.md delete mode 100644 .github/ISSUE_TEMPLATE/feature_request.md delete mode 100644 .github/pull_request_template.md delete mode 100644 .github/workflows/auto-assign-issues.yml create mode 100644 .github/workflows/docker-build-push.yml delete mode 100644 .github/workflows/docker-build.yml delete mode 100644 .github/workflows/docs-generate.yml delete mode 100644 .github/workflows/lint-check.yml delete mode 100644 .github/workflows/publish-swagger-docs.yml delete mode 100644 .github/workflows/python-client-tests.yml delete mode 100644 .github/workflows/release-workflow.yml delete mode 100644 .github/workflows/tarball-gen-tests.yml delete mode 100644 .github/workflows/tutorial-tests.yml delete mode 100644 .github/workflows/ucai-core-tests.yml delete mode 100644 .github/workflows/ucai-integration-tests.yml delete mode 100644 .github/workflows/ucai-package-build.yml delete mode 100644 .github/workflows/unit-tests.yml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS deleted file mode 100644 index 0997eb7a8..000000000 --- a/.github/CODEOWNERS +++ /dev/null @@ -1,40 +0,0 @@ -# This is a CODEOWNERS file for unitycatalog -# See https://help.github.com/articles/about-codeowners/ for more information - -* @tdas @dennyglee @rameshchandra - -# Builds and tests -build.sbt @tdas -version.sbt @tdas -/build/ @tdas -/project/ @tdas -/.github/ @tdas -/tests/ @tdas -/integration-tests/ @tdas - -# Binary scripts and configs -/bin/ @tdas -/etc/ @tdas - -# Docs -/docs/ @dennyglee -/mkdocs.yml @dennyglee - -# API -/api/ @rameshchandra @tdas - -# UI -/ui/ @yc-shawn @jamieknight-db - -# AI -/unitycatalog-ai/ @dennyglee @serena-ruan @benwilson2 - -# Spark Connector -/spark-connector/ @tdas @cloud-fan - -# Docker -Dockerfile @dennyglee -*.dockerfile @dennyglee - -# Clients -/clients/ @tdas diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md deleted file mode 100644 index 8bb20115a..000000000 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -name: Bug report -about: Create a bug report to help us improve -labels: "bug" ---- - -**Describe the bug** - - - -**To Reproduce** - -Steps to reproduce the behavior: - -1. ... -2. ... -3. ... - -**Expected behavior** - - - -**System [please complete the following information]:** - -- OS: e.g. [Ubuntu 18.04] - -**Additional context** - - diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md deleted file mode 100644 index 5065058d6..000000000 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -name: Feature request -about: Suggest a new feature -labels: "enhancement" ---- - -**Is your feature request related to a problem? Please describe.** - - - -**Describe the solution you would like** - - - -**Additional context** - - diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md deleted file mode 100644 index 4a1217df6..000000000 --- a/.github/pull_request_template.md +++ /dev/null @@ -1,10 +0,0 @@ -**PR Checklist** - -- [ ] A description of the changes is added to the description of this PR. -- [ ] If there is a related issue, make sure it is linked to this PR. -- [ ] If you've fixed a bug or added code that should be tested, add tests! -- [ ] If you've added or modified a feature, documentation in `docs` is updated - -**Description of changes** - - diff --git a/.github/workflows/auto-assign-issues.yml b/.github/workflows/auto-assign-issues.yml deleted file mode 100644 index 0cf888519..000000000 --- a/.github/workflows/auto-assign-issues.yml +++ /dev/null @@ -1,40 +0,0 @@ -# This workflow has been inspired by https://github.com/MrPowers/quinn/blob/main/.github/workflows/assign-on-comment.yml - -name: Auto Assign Issues On Comment - -on: - issue_comment: - types: [created] - -permissions: - issues: write - -jobs: - auto-assign: - runs-on: ubuntu-latest - if: (!github.event.issue.pull_request) && github.event.comment.body == 'take' - concurrency: - # Only run one a time per user - group: ${{ github.actor }}-auto-assign-issue - steps: - - name: Check if issue can be assigned - id: check-assignee - run: | - # Check if the user is already assigned to the issue - RESPONSE=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -LI https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees/${{ github.event.comment.user.login }} -o /dev/null -w '%{http_code}' -s) - echo "HTTP_CODE=$RESPONSE" >> $GITHUB_ENV - - - name: Assign issue to commenter - if: env.HTTP_CODE == '204' - run: | - # Assign the issue to the user who commented 'take' - echo "Assigning issue #${{ github.event.issue.number }} to @${{ github.event.comment.user.login }}" - curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -d '{"assignees": ["${{ github.event.comment.user.login }}"]}' https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/assignees - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Log failure to assign - if: env.HTTP_CODE != '204' - run: | - # Log the failure to assign the issue - echo "Issue #${{ github.event.issue.number }} cannot be assigned to @${{ github.event.comment.user.login }}. HTTP response code: ${{ env.HTTP_CODE }}" diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml new file mode 100644 index 000000000..f94255325 --- /dev/null +++ b/.github/workflows/docker-build-push.yml @@ -0,0 +1,37 @@ +name: Build and Push Docker Container + +on: + push: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + env: + IMAGE_VERSION: $(date +'%Y%m%d_%H%M%S')_${{ github.sha }}_${{ github.run_number }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to GitHub Container Registry + run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin + + - name: Build and push multi-platform Docker image + run: | + # Build and tag the Docker image with the version + docker buildx create --use + docker buildx build --push \ + --tag ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ env.IMAGE_VERSION }} \ + --platform linux/amd64,linux/arm64 . + + env: + DOCKER_CLI_ACI_AS_TEXT: "true" diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml deleted file mode 100644 index 9b120c9b0..000000000 --- a/.github/workflows/docker-build.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Build and Push Docker Images - -on: - push: - branches: - - main - tags: - - 'v*' - pull_request: - branches: - - main - -env: - IMAGE: ${{ github.repository }} # eg. unitycatalog/unitycatalog - -jobs: - build-and-push: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - - name: Apply metadata and tags - id: meta - uses: docker/metadata-action@v5 - with: - images: ${{ env.IMAGE }} - - # TODO: Agree on a strategy for publishing to DockerHub - # - name: Login to Docker Hub - # uses: docker/login-action@v3 - # with: - # username: ${{ vars.DOCKERHUB_USERNAME }} - # password: ${{ secrets.DOCKERHUB_TOKEN }} - - - name: Build and push Docker image - uses: docker/build-push-action@v6 - with: - context: . - push: false # TODO: When we are ready to publish, change this to: ${{ github.event_name != 'pull_request' }} - platforms: linux/amd64,linux/arm64 - tags: ${{ steps.meta.outputs.tags }} - labels: ${{ steps.meta.outputs.labels }} - - # TODO: Agree on a caching strategy - # NOTE: See here for an explanation of registry caching: https://tinyurl.com/4b8mfexr - # cache-from: type=registry,ref=${{ env.IMAGE }}:buildcache - # cache-to: type=registry,ref=${{ env.IMAGE }}:buildcache,mode=max diff --git a/.github/workflows/docs-generate.yml b/.github/workflows/docs-generate.yml deleted file mode 100644 index b83b9e400..000000000 --- a/.github/workflows/docs-generate.yml +++ /dev/null @@ -1,55 +0,0 @@ -name: Docs Generation Tests - -on: - pull_request: - types: [opened, synchronize, reopened] - push: - branches: [main] - -jobs: - docs-generate: - runs-on: ubuntu-22.04 - steps: - - name: Check out - uses: actions/checkout@v4 - - - name: Set up Python - run: | - python -m venv venv - . ./venv/bin/activate - pip install -r requirements-docs.txt - - - name: Check documentation - run: | - . ./venv/bin/activate - mkdocs build --strict - - openapi-docs-validation: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Generate OpenAPI API and Model docs - run: build/sbt generate - - - name: Check Generated Docs Differences - run: | - DOCS_DIFF=$(git ls-files --others --modified --exclude-standard api) - if [[ -n $DOCS_DIFF ]]; then - echo "This PR contains changes that should also update the generated docs using build/sbt generate" - echo "If you have changed the UC REST APIs such that changes to generated docs are expected, then please make sure all generated docs have been properly updated in this PR." - echo "Otherwise, without changes to UC REST APIs, manual changes to the generated docs are not acceptable." - echo "Modified or untracked doc files:" - echo "$DOCS_DIFF" - exit 1 - else - echo "No changes to generated docs detected." - fi - shell: bash \ No newline at end of file diff --git a/.github/workflows/lint-check.yml b/.github/workflows/lint-check.yml deleted file mode 100644 index b8e4e686d..000000000 --- a/.github/workflows/lint-check.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Code Format Check - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - lint: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up node.js - uses: actions/setup-node@v4 - with: - node-version: '16' - - - name: Run lint check - run: | - (cd ui && yarn install && yarn test:format) - - java-fmt: - runs-on: ubuntu-latest - permissions: - contents: read - pull-requests: read - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Run Java format check - run: | - build/sbt javafmtCheck \ No newline at end of file diff --git a/.github/workflows/publish-swagger-docs.yml b/.github/workflows/publish-swagger-docs.yml deleted file mode 100644 index ec1526d80..000000000 --- a/.github/workflows/publish-swagger-docs.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Publish Swagger Docs - -on: - push: - branches: - - main - -jobs: - build: - runs-on: ubuntu-latest - permissions: - contents: write - pages: write - steps: - - uses: actions/checkout@v4 - - name: Generate Swagger UI - uses: Legion2/swagger-ui-action@v1 - with: - output: ./swagger-ui/swagger-docs - spec-file: ./api/all.yaml - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Prepare deployment directory for Swagger UI - run: | - mkdir -p swagger-docs - mv swagger-ui/* ./swagger-docs/ - - - name: Deploy to GitHub Pages - uses: peaceiris/actions-gh-pages@v3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./swagger-docs - keep_files: true diff --git a/.github/workflows/python-client-tests.yml b/.github/workflows/python-client-tests.yml deleted file mode 100644 index 70367922f..000000000 --- a/.github/workflows/python-client-tests.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: Python Client Tests - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.9' - - - name: Install dependencies - run: pip install requests pytest pytest-asyncio - - - name: Generate the client library, install it, and run the tests - run: ./clients/python/run-tests.sh diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml deleted file mode 100644 index fb3e87370..000000000 --- a/.github/workflows/release-workflow.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Release Workflow - -on: - push: - tags: - - 'v*.*.*' - -jobs: - build: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Build tarball - run: build/sbt createTarball - - name: Upload Release Asset - uses: actions/upload-artifact@v2 - with: - name: unitycatalog - path: target/unitycatalog-*.tar.gz diff --git a/.github/workflows/tarball-gen-tests.yml b/.github/workflows/tarball-gen-tests.yml deleted file mode 100644 index 8ecc39d93..000000000 --- a/.github/workflows/tarball-gen-tests.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Tarball Generation Tests - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -jobs: - test: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Build tarball - run: build/sbt createTarball - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - - - name: Install dependencies - run: | - python -m venv venv - source venv/bin/activate - pip install requests - - - name: Test tarball - run: | - source venv/bin/activate - python tests/test_tarball_generation.py \ No newline at end of file diff --git a/.github/workflows/tutorial-tests.yml b/.github/workflows/tutorial-tests.yml deleted file mode 100644 index e01ac1932..000000000 --- a/.github/workflows/tutorial-tests.yml +++ /dev/null @@ -1,39 +0,0 @@ -name: Tutorial Tests - -on: - push: - branches: [ "main" ] - pull_request: - branches: [ "main" ] - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: '3.8' - - - name: Install dependencies - run: | - python -m venv venv - source venv/bin/activate - pip install requests - pip install duckdb==1.0.0 - - - name: Test Tutorial - run: | - source venv/bin/activate - python tests/test_tutorial.py \ No newline at end of file diff --git a/.github/workflows/ucai-core-tests.yml b/.github/workflows/ucai-core-tests.yml deleted file mode 100644 index 842b536d8..000000000 --- a/.github/workflows/ucai-core-tests.yml +++ /dev/null @@ -1,66 +0,0 @@ -name: UCAI Core Tests - -on: - push: - branches: - - main - paths: - - ai/** - - .github/workflows/ucai-*.yml - pull_request: - paths: - - ai/** - - .github/workflows/ucai-*.yml - -jobs: - lint: - runs-on: ubuntu-latest - timeout-minutes: 10 - defaults: - run: - working-directory: ai - steps: - - name: Check out code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.9' - - name: Install dependencies - run: | - pip install -r requirements/lint-requirements.txt - - name: Lint Python code with ruff - run: | - ruff check . - ruff format --check . - - name: Lint YAML files with yamllint - run: yamllint . - - core_tests: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - pydantic-version: [1, 2] - timeout-minutes: 20 - defaults: - run: - working-directory: ai/core - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install .[dev] - if [ ${{ matrix.pydantic-version }} == 1 ]; then - pip install 'pydantic<2' - else - pip install 'pydantic<3,>=2' - fi - - name: Run tests - run: | - pytest tests/ diff --git a/.github/workflows/ucai-integration-tests.yml b/.github/workflows/ucai-integration-tests.yml deleted file mode 100644 index 320ef9e4a..000000000 --- a/.github/workflows/ucai-integration-tests.yml +++ /dev/null @@ -1,167 +0,0 @@ -name: UnityCatalog AI Integration Tests - -on: - push: - branches: - - main - paths: - - ai/integrations/** - - .github/workflows/ucai-integration-tests.yml - pull_request: - paths: - - ai/integrations/** - - .github/workflows/ucai-integration-tests.yml - -permissions: - contents: read - -jobs: - crewai_test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install core/. - echo "PYTHONPATH=$(pwd)/core/src:\$PYTHONPATH" >> $GITHUB_ENV - pip install integrations/crewai[dev] - - name: Run tests - run: | - pytest integrations/crewai/tests - - langchain_test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install Core Library and Langchain Integration - run: | - pip install core/. - echo "PYTHONPATH=$(pwd)/core/src:\$PYTHONPATH" >> $GITHUB_ENV - pip install integrations/langchain[dev] - - name: Run Langchain Tests - run: | - pytest integrations/langchain/tests - - anthropic_test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install Core Library and Anthropic Integration - run: | - pip install core/. - echo "PYTHONPATH=$(pwd)/core/src:\$PYTHONPATH" >> $GITHUB_ENV - pip install integrations/anthropic[dev] - - name: Run Anthropic Tests - run: | - pytest integrations/anthropic/tests - - llamaindex_test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install Core Library and LlamaIndex Integration - run: | - pip install core/. - echo "PYTHONPATH=$(pwd)/core/src:\$PYTHONPATH" >> $GITHUB_ENV - pip install integrations/llama_index[dev] - - name: Run LlamaIndex Tests - run: | - pytest integrations/llama_index/tests - - openai_test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install Core Library and OpenAI Integration - run: | - pip install core/. - echo "PYTHONPATH=$(pwd)/core/src:\$PYTHONPATH" >> $GITHUB_ENV - pip install integrations/openai[dev] - - name: Run OpenAI Tests - run: | - pytest integrations/openai/tests - - autogen_test: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install core/. - echo "PYTHONPATH=$(pwd)/core/src:\$PYTHONPATH" >> $GITHUB_ENV - pip install integrations/autogen[dev] - - name: Run tests - run: | - pytest integrations/autogen/tests diff --git a/.github/workflows/ucai-package-build.yml b/.github/workflows/ucai-package-build.yml deleted file mode 100644 index 9e9f3a1c0..000000000 --- a/.github/workflows/ucai-package-build.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: Test package build - -on: - push: - branches: - - main - paths: - - ai/** - - .github/workflows/ucai-*.yml - pull_request: - paths: - - ai/** - - .github/workflows/ucai-*.yml - -jobs: - build: - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.9', '3.10'] - timeout-minutes: 20 - defaults: - run: - working-directory: ai/core - steps: - - name: Checkout code - uses: actions/checkout@v4 - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - pip install hatch - - name: Build distribution files - id: build-dist - run: | - hatch build - # List distribution files and check their file sizes - ls -lh dist - # Set step outputs - sdist_path=$(find dist -type f -name "*.tar.gz") - wheel_path=$(find dist -type f -name "*.whl") - wheel_name=$(basename $wheel_path) - wheel_size=$(stat -c %s $wheel_path) - echo "sdist-path=${sdist_path}" >> $GITHUB_OUTPUT - echo "wheel-path=${wheel_path}" >> $GITHUB_OUTPUT - echo "wheel-name=${wheel_name}" >> $GITHUB_OUTPUT - echo "wheel-size=${wheel_size}" >> $GITHUB_OUTPUT - - name: Compare files in source and binary distributions - run: | - tar -tzf ${{ steps.build-dist.outputs.sdist-path }} | grep -v '/$' | cut -d'/' -f2- | sort > /tmp/source.txt - zipinfo -1 ${{ steps.build-dist.outputs.wheel-path }} | sort > /tmp/wheel.txt - diff /tmp/source.txt /tmp/wheel.txt || true - - name: Test installation from tarball - run: | - pip install ${{ steps.build-dist.outputs.sdist-path }} - python -c "import unitycatalog.ai.core; print(unitycatalog.ai.core.__version__)" - - name: Test installation from wheel - run: | - pip install --force-reinstall ${{ steps.build-dist.outputs.wheel-path }} - python -c "import unitycatalog.ai.core; print(unitycatalog.ai.core.__version__)" diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index f87368d29..000000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This workflow uses actions that are not certified by GitHub. -# They are provided by a third-party and are governed by -# separate terms of service, privacy policy, and support -# documentation. - -name: Unit Tests - -on: - push: - branches: [ "main" ] - pull_request: - -permissions: - contents: read - -jobs: - test: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - name: Set up JDK 17 - uses: actions/setup-java@v4 - with: - java-version: '17' - distribution: 'temurin' - - - name: Run tests with coverage - run: build/sbt -J-Xmx2G +jacoco - - name: Run license check - run: build/sbt licenseCheck \ No newline at end of file