From c929865f6cf16b51f3faa6d32a132f203fb87947 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:10:08 -0800 Subject: [PATCH 01/10] pr_checks require all --- .github/workflows/pr_checks.yaml | 48 +++++++++++++++++++++++++------- 1 file changed, 38 insertions(+), 10 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index f629f9331..5edabf18c 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -97,7 +97,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} install-gui: - needs: [ install-root, install-core ] + needs: [install-root, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -158,7 +158,7 @@ jobs: npx tsc --noEmit binary-checks: - needs: [ install-root, install-core ] + needs: [install-root, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -194,7 +194,7 @@ jobs: npx tsc --noEmit install-vscode: - needs: [ install-root, install-core ] + needs: [install-root, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -283,7 +283,7 @@ jobs: vscode-get-test-file-matrix: runs-on: ubuntu-latest - needs: [ install-root, install-vscode ] + needs: [install-root, install-vscode] outputs: test_file_matrix: ${{ steps.vscode-get-test-file-matrix.outputs.test_file_matrix }} steps: @@ -312,7 +312,7 @@ jobs: vscode-package-extension: runs-on: ubuntu-latest - needs: [ install-vscode, install-core ] + needs: [install-vscode, install-core] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -344,7 +344,7 @@ jobs: vscode-download-e2e-dependencies: runs-on: ubuntu-latest - needs: [ install-vscode, install-core ] + needs: [install-vscode, install-core] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -390,7 +390,7 @@ jobs: fail-fast: false matrix: test_file: ${{ fromJson(needs.vscode-get-test-file-matrix.outputs.test_file_matrix) }} - command: [ "e2e:ci:run", "e2e:ci:run-yaml" ] + command: ["e2e:ci:run", "e2e:ci:run-yaml"] steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 @@ -451,7 +451,7 @@ jobs: path: extensions/vscode/e2e/storage/screenshots gui-tests: - needs: [ install-gui, install-core ] + needs: [install-gui, install-core] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -482,7 +482,7 @@ jobs: npm test jetbrains-tests: - needs: [ install-root, core-checks ] + needs: [install-root, core-checks] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -578,4 +578,32 @@ jobs: with: name: jb-failure-report path: | - ${{ github.workspace }}/extensions/intellij/build/reports \ No newline at end of file + ${{ github.workspace }}/extensions/intellij/build/reports + + check: + if: always() + runs-on: ubuntu-latest + needs: + - install-root + - install-core + - core-checks + - install-gui + - gui-checks + - binary-checks + - install-vscode + - vscode-checks + - core-tests + - vscode-get-test-file-matrix + - vscode-package-extension + - vscode-download-e2e-dependencies + - vscode-e2e-tests + - gui-tests + - jetbrains-tests + + steps: + - name: Decide whether the needed jobs succeeded or failed + uses: re-actors/alls-green@release/v1 + with: + allowed-failures: [] + allowed-skips: [] + jobs: ${{ toJSON(needs) }} From 2260300d6478383aed22ad0e5399964dc2d8ac12 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:12:34 -0800 Subject: [PATCH 02/10] use production environment for core-checks --- .github/workflows/pr_checks.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 5edabf18c..c01e2fe67 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -70,6 +70,7 @@ jobs: core-checks: needs: install-core runs-on: ubuntu-latest + environment: production steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From 97309a61faeb9475e3948665073036a7d01389d0 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:14:59 -0800 Subject: [PATCH 03/10] fix syntax --- .github/workflows/pr_checks.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index c01e2fe67..351b4707e 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -605,6 +605,6 @@ jobs: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: - allowed-failures: [] - allowed-skips: [] + allowed-failures: + allowed-skips: jobs: ${{ toJSON(needs) }} From caca9a9612f50f362eee38263380a712a000e3e5 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:22:30 -0800 Subject: [PATCH 04/10] only require approval on forks --- .github/workflows/pr_checks.yaml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 351b4707e..b9db610a8 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -70,8 +70,12 @@ jobs: core-checks: needs: install-core runs-on: ubuntu-latest - environment: production + environment: ${{ github.event.pull_request.head.repo.fork && 'production' || '' }} steps: + - name: Print whether fork + run: | + echo "Fork: ${github.event.pull_request.head.repo.fork}" + - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: From 4955a6fa1a58745bcd83d281489111f2faf775f6 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:24:09 -0800 Subject: [PATCH 05/10] fix syntax --- .github/workflows/pr_checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index b9db610a8..483b782c0 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -74,7 +74,7 @@ jobs: steps: - name: Print whether fork run: | - echo "Fork: ${github.event.pull_request.head.repo.fork}" + echo "Fork: ${{ github.event.pull_request.head.repo.fork }}" - uses: actions/checkout@v4 - uses: actions/setup-node@v4 From c236b6c87c93dd720acaaad87d3f5cc5022587ae Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:39:31 -0800 Subject: [PATCH 06/10] rename --- .github/workflows/pr_checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 483b782c0..e93302d09 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -585,7 +585,7 @@ jobs: path: | ${{ github.workspace }}/extensions/intellij/build/reports - check: + require-all-checks-to-pass: if: always() runs-on: ubuntu-latest needs: From b729174dff8cb8d172e23b0256abffa0fb54c106 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 15:57:00 -0800 Subject: [PATCH 07/10] change env --- .github/workflows/pr_checks.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index e93302d09..e94065589 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -70,7 +70,7 @@ jobs: core-checks: needs: install-core runs-on: ubuntu-latest - environment: ${{ github.event.pull_request.head.repo.fork && 'production' || '' }} + environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }} steps: - name: Print whether fork run: | From 105bb380349e603467449c3f0d8b7016d5bed767 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 16:05:58 -0800 Subject: [PATCH 08/10] add comments and require environment at the top of the file --- .github/workflows/pr_checks.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index e94065589..1e080a2d7 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -21,6 +21,9 @@ on: - "gui/**" - ".github/workflows/**" +# Tests requiring secrets need approval from maintainers +environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }} + jobs: install-root: runs-on: ubuntu-latest @@ -70,7 +73,6 @@ jobs: core-checks: needs: install-core runs-on: ubuntu-latest - environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }} steps: - name: Print whether fork run: | @@ -399,8 +401,7 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" + with: node-version-k - uses: actions/cache@v4 id: vscode-node-modules-cache @@ -585,6 +586,9 @@ jobs: path: | ${{ github.workspace }}/extensions/intellij/build/reports + # GitHub does not have a way of requiring that all checks pass (you must manually select each job) + # This action at least lets us manage the list of required tests via source control + # so that creators of new jobs can add them to this list require-all-checks-to-pass: if: always() runs-on: ubuntu-latest From 06b3cb35a0b7d51152f0b75a051c5ada5aaba135 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 17:03:28 -0800 Subject: [PATCH 09/10] fix syntax error --- .github/workflows/pr_checks.yaml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 1e080a2d7..9b5a858f8 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -21,9 +21,6 @@ on: - "gui/**" - ".github/workflows/**" -# Tests requiring secrets need approval from maintainers -environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }} - jobs: install-root: runs-on: ubuntu-latest @@ -73,11 +70,9 @@ jobs: core-checks: needs: install-core runs-on: ubuntu-latest + # Tests requiring secrets need approval from maintainers + environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }} steps: - - name: Print whether fork - run: | - echo "Fork: ${{ github.event.pull_request.head.repo.fork }}" - - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: @@ -393,6 +388,8 @@ jobs: install-core, ] runs-on: ubuntu-latest + # Tests requiring secrets need approval from maintainers + environment: ${{ github.event.pull_request.head.repo.fork && 'tests-requiring-secrets' || '' }} strategy: fail-fast: false matrix: From 23c595cf3d649a088f4e8832253ae0bdddadedf3 Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 21 Jan 2025 17:06:49 -0800 Subject: [PATCH 10/10] fix syntax again --- .github/workflows/pr_checks.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 9b5a858f8..81fb93701 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -398,7 +398,8 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 - with: node-version-k + with: + node-version-file: ".nvmrc" - uses: actions/cache@v4 id: vscode-node-modules-cache