From a422ab1b8fb59bb4afc9a3b7cffaf92cbcdda70f Mon Sep 17 00:00:00 2001 From: ponmileleke54-dev Date: Mon, 31 Aug 2026 11:36:58 +0000 Subject: [PATCH] fix: remove duplicate PR test gate --- .github/workflows/pr-test-gate.yml | 83 +++++++++--------------------- 1 file changed, 23 insertions(+), 60 deletions(-) diff --git a/.github/workflows/pr-test-gate.yml b/.github/workflows/pr-test-gate.yml index 49c97b09..35bd27d7 100644 --- a/.github/workflows/pr-test-gate.yml +++ b/.github/workflows/pr-test-gate.yml @@ -1,76 +1,39 @@ name: PR Test Gate on: - pull_request: - branches: - - main + workflow_run: + workflows: ["CI"] + types: [completed] jobs: contracts-test: name: Contracts cargo test runs-on: ubuntu-latest + if: github.event.workflow_run.event == 'pull_request' steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Rust - uses: dtolnay/rust-toolchain@stable - with: - targets: wasm32-unknown-unknown - - - name: Run cargo test - run: cargo test - working-directory: contracts + - name: Verify CI succeeded for the pull request + env: + CI_CONCLUSION: ${{ github.event.workflow_run.conclusion }} + PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} + run: | + if [ "$CI_CONCLUSION" != "success" ]; then + echo "CI workflow failed for pull request #${PR_NUMBER}." + exit 1 + fi + echo "CI workflow succeeded for pull request #${PR_NUMBER}; no duplicate contract run is required." backend-test: name: Backend npm test runs-on: ubuntu-latest - services: - postgres: - image: postgres:15 - env: - POSTGRES_USER: postgres - POSTGRES_PASSWORD: password - POSTGRES_DB: flowfi_test - ports: - - 5432:5432 - options: >- - --health-cmd "pg_isready -U postgres" - --health-interval 10s - --health-timeout 5s - --health-retries 5 + if: github.event.workflow_run.event == 'pull_request' steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version: "20" - cache: "npm" - cache-dependency-path: package-lock.json - - - name: Install dependencies - run: npm ci --include=optional - - - name: Prepare database schema - run: | - npx prisma generate --schema=prisma/schema.prisma - npx prisma db push --accept-data-loss --schema=prisma/schema.prisma - working-directory: backend + - name: Verify CI succeeded for the pull request env: - DATABASE_URL: postgresql://postgres:password@127.0.0.1:5432/flowfi_test - - - name: Install Native Bindings + CI_CONCLUSION: ${{ github.event.workflow_run.conclusion }} + PR_NUMBER: ${{ github.event.workflow_run.pull_requests[0].number }} run: | - npm install @rollup/rollup-linux-x64-gnu --no-save - working-directory: backend - - - name: Run backend tests - run: | - ls -la src/generated/prisma - npm test --silent -- --reporter=basic - working-directory: backend - env: - DATABASE_URL: postgresql://postgres:password@127.0.0.1:5432/flowfi_test - NODE_ENV: test + if [ "$CI_CONCLUSION" != "success" ]; then + echo "CI workflow failed for pull request #${PR_NUMBER}." + exit 1 + fi + echo "CI workflow succeeded for pull request #${PR_NUMBER}; no duplicate backend run is required."