From a9004f10a85cc552880e829fa0c67c1f35e0a26b Mon Sep 17 00:00:00 2001 From: bracesproul Date: Wed, 12 Jun 2024 11:35:20 -0700 Subject: [PATCH] fix if integrations --- .github/workflows/unit-tests-integrations.yml | 21 +++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/.github/workflows/unit-tests-integrations.yml b/.github/workflows/unit-tests-integrations.yml index b37b8950af3a..03aed75005a6 100644 --- a/.github/workflows/unit-tests-integrations.yml +++ b/.github/workflows/unit-tests-integrations.yml @@ -25,6 +25,22 @@ concurrency: cancel-in-progress: true jobs: + get-changed-files: + runs-on: ubuntu-latest + outputs: + changed_files: ${{ steps.get_changes.outputs.changed_files }} + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 2 + - name: Get changes + id: get_changes + run: | + echo "changed_files<> $GITHUB_OUTPUT + git diff --name-only -r HEAD^1 HEAD | while read line; do printf "%s\n" "$line"; done >> $GITHUB_OUTPUT + echo "EOF" >> $GITHUB_OUTPUT + unit-tests: name: Unit Tests strategy: @@ -39,10 +55,7 @@ jobs: # - os: macos-latest # node-version: 20.x runs-on: ${{ matrix.os }} - if: | - github.event_name == 'pull_request' && - (contains(github.event.pull_request.paths, 'langchain-core') || - contains(github.event.pull_request.paths, 'libs/langchain-${{ matrix.package }}')) + if: contains(needs.get-changed-files.outputs.changed_files, 'langchain-core/') || contains(needs.get-changed-files.outputs.changed_files, 'libs/langchain-${{ matrix.package }}/') env: PUPPETEER_SKIP_DOWNLOAD: "true" PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD: "true"