aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-03-31 17:24:18 -0700
committerDhravya <[email protected]>2024-03-31 17:24:18 -0700
commitdbba7c31ac354146ddfa5dc901e1e5586b542fc5 (patch)
tree0997cfb424ddcffb20a8363beb821be8d3b8173f /.github/workflows
parent(ci): update CI again (diff)
downloadsupermemory-dbba7c31ac354146ddfa5dc901e1e5586b542fc5.tar.xz
supermemory-dbba7c31ac354146ddfa5dc901e1e5586b542fc5.zip
update CI and test
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/build.yml38
1 files changed, 29 insertions, 9 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index b2bb67a9..26989559 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -18,18 +18,38 @@ jobs:
prepare:
runs-on: ubuntu-latest
outputs:
- web_changed: ${{ steps.set_outputs.outputs.web_changed }}
- extension_changed: ${{ steps.set_outputs.outputs.extension_changed }}
- cf_ai_backend_changed: ${{ steps.set_outputs.outputs.cf_ai_backend_changed }}
+ web_changed: ${{ steps.detect_changes.outputs.web_changed }}
+ extension_changed: ${{ steps.detect_changes.outputs.extension_changed }}
+ cf_ai_backend_changed: ${{ steps.detect_changes.outputs.cf_ai_backend_changed }}
steps:
- uses: actions/checkout@v3
- - name: Set Outputs
- id: set_outputs
+ - name: Fetching all history for all tags and branches
+ run: git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
+ - name: Detect Changes
+ id: detect_changes
run: |
- echo "web_changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'apps/web/' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
- echo "extension_changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'apps/extension/' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
- echo "cf_ai_backend_changed=$(git diff --name-only ${{ github.event.before }} ${{ github.sha }} | grep -q 'apps/cf-ai-backend/' && echo 'true' || echo 'false')" >> $GITHUB_OUTPUT
-
+ WEB_CHANGED="false"
+ EXTENSION_CHANGED="false"
+ CF_AI_BACKEND_CHANGED="false"
+ if [ "${{ github.event_name }}" = "push" ]; then
+ DIFF_REF="${{ github.event.before }} ${{ github.sha }}"
+ else
+ DIFF_REF="${{ github.base_ref }}...${{ github.head_ref }}"
+ fi
+ if git diff --name-only $DIFF_REF | grep -q 'apps/web/'; then
+ WEB_CHANGED="true"
+ fi
+ if git diff --name-only $DIFF_REF | grep -q 'apps/extension/'; then
+ EXTENSION_CHANGED="true"
+ fi
+ if git diff --name-only $DIFF_REF | grep -q 'apps/cf-ai-backend/'; then
+ CF_AI_BACKEND_CHANGED="true"
+ fi
+ echo "web_changed=$WEB_CHANGED" >> $GITHUB_OUTPUT
+ echo "extension_changed=$EXTENSION_CHANGED" >> $GITHUB_OUTPUT
+ echo "cf_ai_backend_changed=$CF_AI_BACKEND_CHANGED" >> $GITHUB_OUTPUT
+ echo "Differences detected: WEB=$WEB_CHANGED, EXTENSION=$EXTENSION_CHANGED, CF_AI_BACKEND=$CF_AI_BACKEND_CHANGED"
+
build-extension:
needs: prepare
if: needs.prepare.outputs.extension_changed == 'true'