From 3d1afe74edad3d73fce248fcdddb26634bb957bd Mon Sep 17 00:00:00 2001 From: Vasilije <8619304+Vasilije1990@users.noreply.github.com> Date: Thu, 8 Aug 2024 17:53:30 +0200 Subject: [PATCH] fix poetry --- .github/workflows/test_common.yml | 84 +++---------------------------- 1 file changed, 8 insertions(+), 76 deletions(-) diff --git a/.github/workflows/test_common.yml b/.github/workflows/test_common.yml index b28fd977a..8165b339a 100644 --- a/.github/workflows/test_common.yml +++ b/.github/workflows/test_common.yml @@ -24,21 +24,8 @@ jobs: strategy: fail-fast: false matrix: - # os: ["ubuntu-latest", "macos-latest"] os: ["ubuntu-latest"] steps: - # - name: Install Docker - # run: | - # HOMEBREW_NO_AUTO_UPDATE=1 brew install --cask docker - # sudo /Applications/Docker.app/Contents/MacOS/Docker --unattended --install-privileged-components - # open -a /Applications/Docker.app --args --unattended --accept-license - # echo "We are waiting for Docker to be up and running. It can take over 2 minutes..." - # while ! /Applications/Docker.app/Contents/Resources/bin/docker info &>/dev/null; do sleep 1; done - # if: runner.os == 'macOS' - - # - name: Set up QEMU - # uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -49,16 +36,13 @@ jobs: strategy: fail-fast: false matrix: - os: ["ubuntu-latest"] #, "windows-latest", "macos-latest" + os: ["ubuntu-latest"] python-version: ["3.11.x"] - # Test all python versions on ubuntu only include: - python-version: "3.9.x" os: "ubuntu-22.04" - python-version: "3.10.x" os: "ubuntu-22.04" -# - python-version: "3.12.x" -# os: "ubuntu-latest" defaults: run: @@ -75,6 +59,11 @@ jobs: - postgres_data:/var/lib/postgresql/data ports: - 5432:5432 + options: >- + --health-cmd="pg_isready -U $POSTGRES_USER" + --health-interval=10s + --health-timeout=5s + --health-retries=5 runs-on: ${{ matrix.os }} @@ -100,7 +89,6 @@ jobs: shell: cmd - name: Install Poetry - # https://github.com/snok/install-poetry#running-on-windows uses: snok/install-poetry@v1.3.2 with: virtualenvs-create: true @@ -118,7 +106,7 @@ jobs: - name: Wait for PostgreSQL to be ready run: | echo "Waiting for PostgreSQL to be ready..." - until pg_isready -h localhost -p 5432 -U cognee; do + until docker exec ${RUNNER_USER_NAME}-postgres pg_isready -U cognee; do sleep 1 done @@ -155,62 +143,6 @@ jobs: cd dist pip install *.whl - # - run: | - # poetry run - # if: runner.os != 'Windows' - # name: Run common tests with minimum dependencies Linux/MAC - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }} - # QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }} - - # - run: | - # poetry run python ./cognee/tests/test_library.py - # if: runner.os == 'Windows' - # name: Run common tests with minimum dependencies Windows - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }} - # QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }} - # shell: cmd - - # - name: Install dependencies - # run: poetry install --no-interaction - - # - name: Build with Poetry - # run: poetry build - - # - name: Install Package - # run: | - # cd dist - # pip install *.whl - - # - name: Download NLTK Punkt Tokenizer Models - # run: | - # python -m nltk.downloader punkt - # - run: | - # poetry run python ./cognee/tests/test_library.py - # if: runner.os != 'Windows' - # name: Run pipeline smoke tests with minimum deps Linux/MAC - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }} - # QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }} - - # - name: Download NLTK Punkt Tokenizer Models - # run: | - # python -m nltk.downloader punkt - # - run: | - # poetry run python ./cognee/tests/test_library.py - # if: runner.os == 'Windows' - # name: Run smoke tests with minimum deps Windows - # env: - # OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - # QDRANT_API_KEY: ${{ secrets.QDRANT_API_KEY }} - # QDRANT_API_URL: ${{ secrets.QDRANT_API_URL }} - # shell: cmd - - matrix_job_required_check: name: common | common tests needs: run_common @@ -220,4 +152,4 @@ jobs: - name: Check matrix job results if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') run: | - echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1 \ No newline at end of file + echo "One or more matrix job tests failed or were cancelled. You may need to re-run them." && exit 1