diff --git a/frontend/.firebaserc b/.firebaserc similarity index 100% rename from frontend/.firebaserc rename to .firebaserc diff --git a/.github/workflows/deploy-frontend.yml b/.github/workflows/deploy-frontend.yml new file mode 100644 index 00000000..bd6b2a6d --- /dev/null +++ b/.github/workflows/deploy-frontend.yml @@ -0,0 +1,60 @@ +name: Deploy (Frontend) +on: + pull_request: + branches: + - main + # paths: + # - 'frontend/src/**' + # - 'shared/ts/**' + push: + branches: + - main + paths: + - 'frontend/src/**' + - 'shared/ts/**' + +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 21 + - name: Install PNPM + uses: pnpm/action-setup@v2.4.0 + id: pnpm-install + with: + version: 8 + run_install: false + - name: Setup PNPM Cache + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - name: Load Cached Dependencies + uses: actions/cache@v3 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install Node dependencies + run: pnpm install -r + - name: build + run: pnpm run build + - uses: FirebaseExtended/action-hosting-deploy@v0 + if: github.event_name != 'pull_request' + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASEMIND_AI_DEVELOPMENT }}' + channelId: live + projectId: basemind-ai-development + - uses: FirebaseExtended/action-hosting-deploy@v0 + if: github.event_name == 'pull_request' + with: + repoToken: '${{ secrets.GITHUB_TOKEN }}' + firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_BASEMIND_AI_DEVELOPMENT }}' + projectId: basemind-ai-development diff --git a/.github/workflows/tests-android.yaml b/.github/workflows/tests-android.yaml index 721bbac7..9652454f 100644 --- a/.github/workflows/tests-android.yaml +++ b/.github/workflows/tests-android.yaml @@ -3,6 +3,11 @@ on: push: branches: - main + paths: + - '*.gradle.kts' + - 'gradle.properties' + - 'gradle/**' + - 'sdks/android/**' pull_request: branches: - main @@ -22,8 +27,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Setup Java uses: actions/setup-java@v3 with: diff --git a/.github/workflows/tests-go.yaml b/.github/workflows/tests-go.yaml index 40d8b2cd..d3d292e0 100644 --- a/.github/workflows/tests-go.yaml +++ b/.github/workflows/tests-go.yaml @@ -3,6 +3,12 @@ on: push: branches: - main + paths: + - 'gen/go/**' + - 'go.*' + - 'services/api-gateway/**' + - 'services/dashboard-backend/**' + - 'shared/go/**' pull_request: branches: - main @@ -29,8 +35,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Setup Golang uses: actions/setup-go@v4 with: diff --git a/.github/workflows/tests-ts.yaml b/.github/workflows/tests-ts.yaml index ee5d1f82..372b4190 100644 --- a/.github/workflows/tests-ts.yaml +++ b/.github/workflows/tests-ts.yaml @@ -3,6 +3,17 @@ on: push: branches: - main + paths: + - 'frontend/**' + - 'gen/ts/**' + - 'package.json' + - 'pnpm-lock.yaml' + - 'pnpm-workspace.yaml' + - 'services/openai-connector/**' + - 'services/cohere-connector/**' + - 'shared/ts/**' + - 'tsconfig.json' + - 'vitest.*' pull_request: branches: - main @@ -29,30 +40,32 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.head.sha }} - name: Setup Node uses: actions/setup-node@v4 with: node-version: 21 - - name: Download the DeepSource CLI - run: curl https://deepsource.io/cli | sh - - name: Install pnpm + - name: Install PNPM uses: pnpm/action-setup@v2.4.0 id: pnpm-install with: version: 8 - - name: Setup pnpm cache + run_install: false + - name: Setup PNPM Cache id: pnpm-cache - run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 - name: Load cached Node dependencies + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - name: Load Cached Dependencies + uses: actions/cache@v3 with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} + path: ${{ env.STORE_PATH }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: ${{ runner.os }}-pnpm-store- + restore-keys: | + ${{ runner.os }}-pnpm-store- - name: Install Node dependencies run: pnpm install -r + - name: Download the DeepSource CLI + run: curl https://deepsource.io/cli | sh - name: Test run: pnpm run test:coverage - name: Upload Coverage Report diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 8e3cef7d..cd600d1d 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -10,12 +10,37 @@ jobs: validate: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 21 + - name: Install PNPM + uses: pnpm/action-setup@v2.4.0 + id: pnpm-install + with: + version: 8 + run_install: false + - name: Setup PNPM Cache + id: pnpm-cache + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + - name: Load Cached Node Dependencies + uses: actions/cache@v3 + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + - name: Install Node dependencies + run: pnpm install -r - name: Setup Golang uses: actions/setup-go@v4 with: go-version: '1.21' - - name: Load cached Golang dependencies + - name: Load Cached Golang Dependencies id: cached-go-dependencies uses: actions/cache@v3 with: @@ -24,36 +49,15 @@ jobs: ~/go/pkg/mod key: go-${{ inputs.go_version }}-v1.0-${{ hashFiles('**/go.sum') }} - name: Install Golang dependencies - if: steps.cached-go-dependencies.outputs.cache-hit != 'true' shell: bash run: go get -v -t ./... - - name: Setup Node - uses: actions/setup-node@v4 - with: - node-version: 21 - - name: Install pnpm - uses: pnpm/action-setup@v2.4.0 - id: pnpm-install - with: - version: 8 - - name: Setup pnpm cache - id: pnpm-cache - run: echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT - - uses: actions/cache@v3 - name: Load cached Node dependencies - with: - path: ${{ steps.pnpm-cache.outputs.STORE_PATH }} - key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} - restore-keys: ${{ runner.os }}-pnpm-store- - - name: Install Node dependencies - run: pnpm install -r - name: Setup Python uses: actions/setup-python@v4 with: python-version: '3.11' - name: Install Pre-Commit run: python -m pip install pre-commit && pre-commit install - - name: Load cached Pre-Commit Dependencies + - name: Load Cached Pre-Commit Dependencies id: cached-pre-commit-dependencies uses: actions/cache@v3 with: diff --git a/.idea/dataSources.xml b/.idea/dataSources.xml index 28ab550a..89dc5c58 100644 --- a/.idea/dataSources.xml +++ b/.idea/dataSources.xml @@ -3,13 +3,13 @@ postgresql true org.postgresql.Driver - jdbc:postgresql://localhost:5432/faithapp + jdbc:postgresql://35.246.201.168:5432/basemind $ProjectFileDir$ + + postgresql + true + org.postgresql.Driver + jdbc:postgresql://localhost:5432/postgres + + + + $ProjectFileDir$ + diff --git a/frontend/firebase.json b/firebase.json similarity index 85% rename from frontend/firebase.json rename to firebase.json index 95e313e6..ddec8670 100644 --- a/frontend/firebase.json +++ b/firebase.json @@ -4,6 +4,6 @@ "region": "europe-west1" }, "ignore": ["firebase.json", "**/.*", "**/node_modules/**"], - "source": "." + "source": "frontend" } } diff --git a/package.json b/package.json index a0a458df..11ce4fb4 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,8 @@ "private": true, "scripts": { "test:coverage": "vitest run --coverage", - "test": "vitest" + "test": "vitest", + "build:frontend": "cd frontend && pnpm run build && cd .." }, "devDependencies": { "@bufbuild/buf": "^1.28.1",