From d4cf574be0c02ee0803574fe79ba3d4ae1075227 Mon Sep 17 00:00:00 2001 From: Eugene Yurtsev Date: Fri, 10 Nov 2023 16:04:29 -0500 Subject: [PATCH] x --- .github/workflows/_test.yml | 57 ------------------- .../workflows/{langserve_ci.yml => ci.yml} | 22 ++++++- 2 files changed, 19 insertions(+), 60 deletions(-) delete mode 100644 .github/workflows/_test.yml rename .github/workflows/{langserve_ci.yml => ci.yml} (77%) diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml deleted file mode 100644 index 04be6a2c..00000000 --- a/.github/workflows/_test.yml +++ /dev/null @@ -1,57 +0,0 @@ -name: test - -on: - workflow_call: - inputs: - working-directory: - required: true - type: string - description: "From which folder this pipeline executes" - -env: - POETRY_VERSION: "1.5.1" - -jobs: - build: - defaults: - run: - working-directory: ${{ inputs.working-directory }} - runs-on: ubuntu-latest - strategy: - matrix: - python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - name: Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v3 - - - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ matrix.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ inputs.working-directory }} - cache-key: core - - - name: Install dependencies - shell: bash - run: poetry install - - - name: Run core tests - shell: bash - run: make test - - - name: Ensure the tests did not create any additional files - shell: bash - run: | - set -eu - - STATUS="$(git status)" - echo "$STATUS" - - # grep will exit non-zero if the target message isn't found, - # and `set -e` above will cause the step to fail. - echo "$STATUS" | grep 'nothing to commit, working tree clean' diff --git a/.github/workflows/langserve_ci.yml b/.github/workflows/ci.yml similarity index 77% rename from .github/workflows/langserve_ci.yml rename to .github/workflows/ci.yml index 6eee23de..97e0545f 100644 --- a/.github/workflows/langserve_ci.yml +++ b/.github/workflows/ci.yml @@ -8,8 +8,7 @@ on: paths: - '.github/actions/poetry_setup/action.yml' - '.github/workflows/_lint.yml' - - '.github/workflows/_test.yml' - - '.github/workflows/langserve_ci.yml' + - '.github/workflows/ci.yml' - 'backend/**' workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI @@ -36,6 +35,7 @@ jobs: secrets: inherit test: + name: Python ${{ matrix.python-version }} tests timeout-minutes: 5 runs-on: ubuntu-latest defaults: @@ -48,8 +48,24 @@ jobs: - "3.9" - "3.10" - "3.11" - name: Python ${{ matrix.python-version }} tests + services: + # label used to access the service container + redis: + # ensure the image version matches the version using locally and on prod + image: redislabs/redisearch:latest + ports: + # maps tcp port 5432 on service container to the host + - 5432:5432 + # set health checks to wait until postgres has started + options: >- + --health-cmd "redis-cli ping" + --health-interval 10s + --health-timeout 5s + --health-retries 5 + steps: + - name: "Check redis is reachable" + run: redis-cli -h localhost -p 5432 ping - uses: actions/checkout@v3 - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}