From 24b17be1d28c4129d31775351f89207834bdebd2 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 10:39:09 +0100 Subject: [PATCH 01/11] Fetch dynamically on lint --- .github/workflows/budibase_ci.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index c04031cc9d..fe2c2d7bc7 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -27,8 +27,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Fetch pro submodule if running in BB + run: | + if [ "$GITHUB_REPOSITORY" = "Budibase/budibase" ]; then + git submodule update --init --recursive + else + echo "Submodule fetch skipped." + fi with: - submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Use Node.js 14.x uses: actions/setup-node@v3 From b04d4f7a80201c9905e4165fff134a8c68d11e19 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 10:42:53 +0100 Subject: [PATCH 02/11] Remove wrong token usage --- .github/workflows/budibase_ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index fe2c2d7bc7..bd5426b7a0 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -34,8 +34,6 @@ jobs: else echo "Submodule fetch skipped." fi - with: - token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Use Node.js 14.x uses: actions/setup-node@v3 with: From f3ffd84da35e9a18f0ca72296696dca64aae0d91 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 10:47:05 +0100 Subject: [PATCH 03/11] Setup env token --- .github/workflows/budibase_ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index bd5426b7a0..390998c8b9 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -28,6 +28,8 @@ jobs: steps: - uses: actions/checkout@v3 - name: Fetch pro submodule if running in BB + env: + PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: | if [ "$GITHUB_REPOSITORY" = "Budibase/budibase" ]; then git submodule update --init --recursive From dacbc02002744bdaa9bc458911a1a2a6af024e32 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 10:48:41 +0100 Subject: [PATCH 04/11] Setup env token --- .github/workflows/budibase_ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 390998c8b9..b61f2eab67 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -32,7 +32,7 @@ jobs: PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} run: | if [ "$GITHUB_REPOSITORY" = "Budibase/budibase" ]; then - git submodule update --init --recursive + GIT_TERMINAL_PROMPT=0 git -c "http.extraheader=Authorization: Bearer $PERSONAL_ACCESS_TOKEN" git submodule update --init --recursive else echo "Submodule fetch skipped." fi From cfd6f2e76256290a682b0aeed5def62afefe68fb Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 11:13:09 +0100 Subject: [PATCH 05/11] Fetch only when running in the repo --- .github/workflows/budibase_ci.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index b61f2eab67..bb5f5089a0 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -26,16 +26,17 @@ jobs: lint: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Fetch pro submodule if running in BB - env: - PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }} - run: | - if [ "$GITHUB_REPOSITORY" = "Budibase/budibase" ]; then - GIT_TERMINAL_PROMPT=0 git -c "http.extraheader=Authorization: Bearer $PERSONAL_ACCESS_TOKEN" git submodule update --init --recursive - else - echo "Submodule fetch skipped." - fi + - name: Checkout repo and submodules + uses: actions/checkout@v3 + if: ${{ github.repository == "Budibase/budibase" }} + with: + submodules: true + token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + + - name: Checkout repo only + uses: actions/checkout@v3 + if: ${{ github.repository != "Budibase/budibase" }} + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: From 5274abb9eae6c8bfcc3eb25afb55bdeb33d46c82 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 11:17:23 +0100 Subject: [PATCH 06/11] Fix --- .github/workflows/budibase_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index bb5f5089a0..51b8c245ea 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -28,14 +28,14 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: ${{ github.repository == "Budibase/budibase" }} + if: github.repository == "Budibase/budibase" with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: ${{ github.repository != "Budibase/budibase" }} + if: github.repository != "Budibase/budibase" - name: Use Node.js 14.x uses: actions/setup-node@v3 From 7c24eea873fd46c2cd0a967989946b941f0882d4 Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 11:19:29 +0100 Subject: [PATCH 07/11] Try fixes --- .github/workflows/budibase_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 51b8c245ea..5885041078 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -28,14 +28,14 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == "Budibase/budibase" + if: github.repository == 'Budibase/budibase' with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != "Budibase/budibase" + if: github.repository != 'Budibase/budibase' - name: Use Node.js 14.x uses: actions/setup-node@v3 From f2431f44c330c900fe81411e1aa6515dab867caa Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 11:25:08 +0100 Subject: [PATCH 08/11] Check forks --- .github/workflows/budibase_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 5885041078..2fb9410d3b 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -28,14 +28,14 @@ jobs: steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == 'Budibase/budibase' + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - name: Checkout repo only uses: actions/checkout@v3 - if: github.repository != 'Budibase/budibase' + if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 From f1705f7ed0374b7254ce5ece15dd86322e7708fd Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 12:12:46 +0100 Subject: [PATCH 09/11] Checkout in all steps --- .github/workflows/budibase_ci.yml | 47 +++++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 2fb9410d3b..2a66f2aec8 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -48,10 +48,16 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo and submodules + uses: actions/checkout@v3 + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + + - name: Checkout repo only + uses: actions/checkout@v3 + if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -66,10 +72,16 @@ jobs: test-libraries: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo and submodules + uses: actions/checkout@v3 + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + + - name: Checkout repo only + uses: actions/checkout@v3 + if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -86,10 +98,16 @@ jobs: test-services: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo and submodules + uses: actions/checkout@v3 + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + + - name: Checkout repo only + uses: actions/checkout@v3 + if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -106,10 +124,16 @@ jobs: test-pro: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo and submodules + uses: actions/checkout@v3 + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + + - name: Checkout repo only + uses: actions/checkout@v3 + if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -121,10 +145,16 @@ jobs: integration-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repo and submodules + uses: actions/checkout@v3 + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + + - name: Checkout repo only + uses: actions/checkout@v3 + if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -144,12 +174,17 @@ jobs: check-pro-submodule: runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout repo and submodules uses: actions/checkout@v3 + if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} + - name: Checkout repo only + uses: actions/checkout@v3 + if: github.repository != github.event.pull_request.head.repo.full_name + - name: Check pro commit id: get_pro_commits run: | From 73b397294be8dcd981457cacebfda3c38659916d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 12:33:58 +0100 Subject: [PATCH 10/11] Don't run pro tests on forks --- .github/workflows/budibase_ci.yml | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index 2a66f2aec8..d09793385d 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -32,7 +32,6 @@ jobs: with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only uses: actions/checkout@v3 if: github.repository != github.event.pull_request.head.repo.full_name @@ -54,10 +53,10 @@ jobs: with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only uses: actions/checkout@v3 if: github.repository != github.event.pull_request.head.repo.full_name + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -78,10 +77,10 @@ jobs: with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only uses: actions/checkout@v3 if: github.repository != github.event.pull_request.head.repo.full_name + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -104,10 +103,10 @@ jobs: with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only uses: actions/checkout@v3 if: github.repository != github.event.pull_request.head.repo.full_name + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -123,17 +122,14 @@ jobs: test-pro: runs-on: ubuntu-latest + if: github.repository == github.event.pull_request.head.repo.full_name steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only - uses: actions/checkout@v3 - if: github.repository != github.event.pull_request.head.repo.full_name - name: Use Node.js 14.x uses: actions/setup-node@v3 with: @@ -151,10 +147,10 @@ jobs: with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only uses: actions/checkout@v3 if: github.repository != github.event.pull_request.head.repo.full_name + - name: Use Node.js 14.x uses: actions/setup-node@v3 with: From bb6d7d610b8444e14895e393e85be5f484accc5d Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Thu, 29 Jun 2023 12:38:12 +0100 Subject: [PATCH 11/11] check-pro-submodule --- .github/workflows/budibase_ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/budibase_ci.yml b/.github/workflows/budibase_ci.yml index d09793385d..4ada96accc 100644 --- a/.github/workflows/budibase_ci.yml +++ b/.github/workflows/budibase_ci.yml @@ -169,18 +169,14 @@ jobs: check-pro-submodule: runs-on: ubuntu-latest + if: github.repository == github.event.pull_request.head.repo.full_name steps: - name: Checkout repo and submodules uses: actions/checkout@v3 - if: github.repository == github.event.pull_request.head.repo.full_name with: submodules: true token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }} - - name: Checkout repo only - uses: actions/checkout@v3 - if: github.repository != github.event.pull_request.head.repo.full_name - - name: Check pro commit id: get_pro_commits run: |