From c7a213896691451e9160e2e52dde0f0c6448bb8c Mon Sep 17 00:00:00 2001 From: Pavel Zorin Date: Mon, 10 Nov 2025 19:11:27 +0100 Subject: [PATCH] CI: uv lock check. Pre-test workflow. --- .github/actions/cognee_setup/action.yml | 5 +++++ .github/workflows/pre_test.yml | 25 +++++++++++++++++++++++++ .github/workflows/test_suites.yml | 8 +++++++- 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/pre_test.yml diff --git a/.github/actions/cognee_setup/action.yml b/.github/actions/cognee_setup/action.yml index 3f5726015..43cd34772 100644 --- a/.github/actions/cognee_setup/action.yml +++ b/.github/actions/cognee_setup/action.yml @@ -10,6 +10,10 @@ inputs: description: "Additional extra dependencies to install (space-separated)" required: false default: "" + rebuild-lockfile: + description: "Whether to rebuild the uv lockfile" + required: false + default: "false" runs: using: "composite" @@ -26,6 +30,7 @@ runs: enable-cache: true - name: Rebuild uv lockfile + if: ${{ inputs.rebuild-lockfile == 'true' }} shell: bash run: | rm uv.lock diff --git a/.github/workflows/pre_test.yml b/.github/workflows/pre_test.yml new file mode 100644 index 000000000..526f5050a --- /dev/null +++ b/.github/workflows/pre_test.yml @@ -0,0 +1,25 @@ +on: + workflow_call: + inputs: + python-version: + required: false + type: string + default: '3.11.x' + +jobs: + check-uv-lock: + name: Validate uv lockfile and project metadata + runs-on: ubuntu-22.04 + steps: + - name: Check out repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install uv + uses: astral-sh/setup-uv@v4 + with: + enable-cache: true + + - name: Validate uv lockfile and project metadata + run: uv lock --check || { echo "'uv lock --check' failed."; echo "Run 'uv lock' and push your changes."; exit 1; } diff --git a/.github/workflows/test_suites.yml b/.github/workflows/test_suites.yml index be1e354fc..27f4508e0 100644 --- a/.github/workflows/test_suites.yml +++ b/.github/workflows/test_suites.yml @@ -18,15 +18,21 @@ env: RUNTIME__LOG_LEVEL: ERROR ENV: 'dev' -jobs: +jobs: + pre-test: + name: basic checks + uses: ./.github/workflows/pre_test.yml + basic-tests: name: Basic Tests uses: ./.github/workflows/basic_tests.yml + needs: [ pre-test ] secrets: inherit e2e-tests: name: End-to-End Tests uses: ./.github/workflows/e2e_tests.yml + needs: [ pre-test ] secrets: inherit distributed-tests: