Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 55 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,57 @@
name: CI

on: [push, pull_request]

on:
push:
branches:
- main
pull_request:
types: [opened, synchronize]
jobs:

commit-lint:
runs-on: ubuntu-latest
steps:
- name: find the prev warning if exist
uses: peter-evans/find-comment@v1
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: "github-actions[bot]"
body-includes: "bad commit message"
- name: Delete comment if exist
if: ${{ steps.fc.outputs.comment-id != 0 }}
uses: actions/github-script@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
github.issues.deleteComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: ${{ steps.fc.outputs.comment-id }},
})
- uses: actions/checkout@v2.5.0
with:
fetch-depth: 0
- run: 'echo "module.exports = {extends: [''@commitlint/config-conventional'']}" > commitlint.config.js'
- uses: wagoid/commitlint-github-action@v1
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
- name: if lint failed
if: ${{ failure() }}
uses: peter-evans/create-or-update-comment@v1
with:
issue-number: ${{ github.event.pull_request.number }}
body: |
Thanks for your contribution :heart:
:broken_heart: Unfortunately, this PR has one ore more **bad commit messages**, it can not be merged. To fix this problem, please refer to:
- [Commit Message Guideline for the First Time Contributor](https://github.com/jina-ai/jina/issues/553)
- [Contributing Guideline](https://github.com/jina-ai/jina/blob/master/CONTRIBUTING.md)

Note, other CI tests will *not* *start* until the commit messages get fixed.

This message will be deleted automatically when the commit messages get fixed.
reaction-type: "eyes"

lint-ruff:
runs-on: ubuntu-latest
steps:
Expand Down Expand Up @@ -35,7 +84,7 @@ jobs:
python -m pip install --upgrade pip
python -m pip install poetry
poetry install --only dev
poetry run black .
poetry run black --check .

env:
CHANGED_FILES: ${{ steps.file_changes.outputs.added_modified }}
Expand Down Expand Up @@ -74,7 +123,7 @@ jobs:

# prep-testbed:
# runs-on: ubuntu-latest
# needs: [lint-flake-8, check-black, import-test]
# needs: [lint-ruff, check-black, import-test]
# steps:
# - uses: actions/checkout@v2.5.0
# - id: set-matrix
Expand All @@ -86,7 +135,7 @@ jobs:
# matrix: ${{ steps.set-matrix.outputs.matrix }}

docarray-test:
needs: [lint-flake-8, check-black, import-test]
needs: [lint-ruff, check-black, import-test]
runs-on: ubuntu-latest
strategy:
fail-fast: false
Expand Down Expand Up @@ -129,7 +178,7 @@ jobs:

# just for blocking the merge until all parallel core-test are successful
success-all-test:
needs: [docarray-test]
needs: [docarray-test, check-mypy, commit-lint]
if: always()
runs-on: ubuntu-latest
steps:
Expand Down
3 changes: 1 addition & 2 deletions tests/integrations/typing/tensor.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import numpy as np

from docarray.typing import Tensor
from docarray import Document
from docarray.typing import Tensor


def test_set_tensor():

class MyDocument(Document):
tensor: Tensor

Expand Down