From a0e1ba79a64fe9c3a07244f830863bea2a8386de Mon Sep 17 00:00:00 2001 From: Kevin Le Seigle Date: Wed, 9 Oct 2024 17:48:45 +0200 Subject: [PATCH] fix: prNumber --- .github/workflows/build-and-test-pr.yml | 28 +++++++++++--------- .github/workflows/build-desktop-reusable.yml | 9 ++++--- .github/workflows/build-mobile-reusable.yml | 13 ++++----- 3 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-and-test-pr.yml b/.github/workflows/build-and-test-pr.yml index 37c55935c2e0..e20182f10edc 100644 --- a/.github/workflows/build-and-test-pr.yml +++ b/.github/workflows/build-and-test-pr.yml @@ -14,7 +14,7 @@ permissions: jobs: determine-affected: name: "Turbo Affected" - if: ${{github.event.pull_request.head.repo.full_name == github.repository }} + if: ${{!github.event.pull_request.head.repo.fork }} uses: LedgerHQ/ledger-live/.github/workflows/turbo-affected-reusable.yml@develop with: head_branch: ${{ github.event.pull_request.head.ref || github.event.merge_group.head_ref }} @@ -24,14 +24,16 @@ jobs: build-desktop: name: "Build Desktop" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && github.event.pull_request.head.repo.full_name == github.repository }} - uses: LedgerHQ/ledger-live/.github/workflows/build-desktop-reusable.yml@develop + if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && !github.event.pull_request.head.repo.fork }} + uses: LedgerHQ/ledger-live/.github/workflows/build-desktop-reusable.yml@fix/ci-master-workflow-inputs + with: + prNumber: ${{ github.event.number }} secrets: inherit test-desktop: name: "Test Desktop" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-desktop') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/test-desktop-reusable.yml@develop secrets: inherit @@ -39,21 +41,23 @@ jobs: build-mobile: name: "Build Mobile" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/build-mobile-reusable.yml@develop secrets: inherit test-mobile: name: "Test Mobile" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}} - uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@develop + if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && !github.event.pull_request.head.repo.fork}} + uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-reusable.yml@fix/ci-master-workflow-inputs + with: + prNumber: ${{ github.event.number }} secrets: inherit test-mobile-e2e: name: "Test Mobile E2E" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'ledger-live-mobile') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/test-mobile-e2e-reusable.yml@develop secrets: inherit @@ -61,28 +65,28 @@ jobs: test-libraries: name: "Test Libraries" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'libs') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'libs') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/test-libs-reusable.yml@develop secrets: inherit test-design-system: name: "Test Design System" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'libs/ui') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'libs/ui') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/test-design-system-reusable.yml@develop secrets: inherit test-web-tools: name: "Test Web Tools" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'apps/web-tools') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'apps/web-tools') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/test-web-tools-reusable.yml@develop secrets: inherit test-cli: name: "Test CLI" needs: determine-affected - if: ${{contains(needs.determine-affected.outputs.paths, 'apps/cli') && github.event.pull_request.head.repo.full_name == github.repository}} + if: ${{contains(needs.determine-affected.outputs.paths, 'apps/cli') && !github.event.pull_request.head.repo.fork}} uses: LedgerHQ/ledger-live/.github/workflows/test-cli-reusable.yml@develop secrets: inherit diff --git a/.github/workflows/build-desktop-reusable.yml b/.github/workflows/build-desktop-reusable.yml index 4b0fab500e49..3ffcd0774344 100644 --- a/.github/workflows/build-desktop-reusable.yml +++ b/.github/workflows/build-desktop-reusable.yml @@ -2,6 +2,11 @@ name: "@Desktop • Build App" on: workflow_call: + inputs: + prNumber: + description: PR number + type: string + required: false workflow_dispatch: inputs: ref: @@ -19,10 +24,6 @@ on: description: The base branch to merge the head into when checking out the code type: string required: false - prNumber: - description: PR number - type: string - required: false permissions: id-token: write diff --git a/.github/workflows/build-mobile-reusable.yml b/.github/workflows/build-mobile-reusable.yml index 347fc148042d..a3f080ed141a 100644 --- a/.github/workflows/build-mobile-reusable.yml +++ b/.github/workflows/build-mobile-reusable.yml @@ -2,6 +2,11 @@ name: "Build Mobile" on: workflow_call: + inputs: + prNumber: + description: PR number + type: string + required: false workflow_dispatch: inputs: ref: @@ -19,10 +24,6 @@ on: description: The base branch to merge the head into when checking out the code type: string required: false - prNumber: - description: PR number - type: string - required: false permissions: id-token: write @@ -111,8 +112,8 @@ jobs: with: max_attempts: 2 timeout_minutes: 15 - command: pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm - new_command_on_retry: rm -rf ~/.cocoapods/ && pnpm clean && pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm + command: pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm + new_command_on_retry: rm -rf ~/.cocoapods/ && pnpm clean && pnpm i --filter="live-mobile..." --filter="ledger-live" --no-frozen-lockfile --unsafe-perm - name: bundle ios and android js run: | pnpm build:llm:deps --api="http://127.0.0.1:${{ steps.caches.outputs.port }}" --token="${{ secrets.TURBOREPO_SERVER_TOKEN }}" --team="foo"