From f5251f65155f587b17046f836373dc35b643cb9d Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:10:04 -0800 Subject: [PATCH 01/20] improv: naming --- .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 02bd2c333..dc76a5258 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -88,7 +88,7 @@ jobs: npx tsc --noEmit npm run lint - - name: Install Xvfb for Linux and run e2e tests + - name: Install Xvfb for Linux and run end to end tests run: | sudo apt-get install -y xvfb # Install Xvfb Xvfb :99 & # Start Xvfb From 653ca205dfbe2f7fec94891c99053d393d3efd0c Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:13:09 -0800 Subject: [PATCH 02/20] fix: actions --- .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 dc76a5258..84d7b5421 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -9,6 +9,7 @@ on: - "extensions/vscode/**" - "core/**" - "gui/**" + - ".github/workflows**" jobs: tsc-check: From 3d4b877b2f68462cced9f918987eaf3055d6c45e Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:14:59 -0800 Subject: [PATCH 03/20] test: ci --- .github/workflows/pr_checks.yaml | 170 ++++++++++++++++++------------- 1 file changed, 97 insertions(+), 73 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 84d7b5421..869c626aa 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -4,125 +4,149 @@ on: pull_request: branches: - main - paths: - "extensions/vscode/**" - "core/**" - "gui/**" - - ".github/workflows**" - jobs: - tsc-check: + setup: runs-on: ubuntu-latest + outputs: + node-version: ${{ steps.node-setup.outputs.node-version }} steps: - # 1. Check-out repository - name: Check-out repository uses: actions/checkout@v4 - # 2. Install npm dependencies - name: Use Node.js from .nvmrc + id: node-setup uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - - name: Cache root node_modules - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + test-extension: + runs-on: ubuntu-latest + needs: setup - - name: Cache extension node_modules - uses: actions/cache@v3 - with: - path: extensions/vscode/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }} + steps: + - name: Check-out repository + uses: actions/checkout@v4 - - name: Cache core node_modules - uses: actions/cache@v3 + - name: Setup Node.js + uses: actions/setup-node@v4 with: - path: core/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }} - - - name: Cache gui node_modules + node-version-file: ".nvmrc" + - name: Cache extension dependencies uses: actions/cache@v3 + id: cache-extension with: - path: gui/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} + path: | + node_modules + extensions/vscode/node_modules + key: ${{ runner.os }}-ext-${{ hashFiles('package-lock.json', 'extensions/vscode/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-ext- - - name: Cache binary node_modules - uses: actions/cache@v3 - with: - path: binary/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('binary/package-lock.json') }} - - - name: root install + - name: Install dependencies + if: steps.cache-extension.outputs.cache-hit != 'true' run: | npm ci - - - name: extensions/vscode install - run: | - cd extensions/vscode - npm ci + cd extensions/vscode && npm ci env: - # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - - name: core install - run: | - cd core - npm ci - - - name: gui install - run: | - cd gui - npm ci - - - name: binary install - run: | - cd binary - npm ci - - - name: extensions/vscode checks + - name: Run checks run: | cd extensions/vscode npx tsc --noEmit npm run lint - - name: Install Xvfb for Linux and run end to end tests + - name: Run e2e tests run: | - sudo apt-get install -y xvfb # Install Xvfb - Xvfb :99 & # Start Xvfb - export DISPLAY=:99 # Export the display number to the environment + sudo apt-get install -y xvfb + Xvfb :99 & + export DISPLAY=:99 cd extensions/vscode npm run package npm run e2e:ci - - name: core checks + test-core: + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Check-out repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - name: Cache core dependencies + uses: actions/cache@v3 + id: cache-core + with: + path: | + node_modules + core/node_modules + key: ${{ runner.os }}-core-${{ hashFiles('package-lock.json', 'core/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-core- + + - name: Install dependencies + if: steps.cache-core.outputs.cache-hit != 'true' + run: | + npm ci + cd core && npm ci + - name: Run checks run: | cd core - npm ci npx tsc --noEmit npm run lint env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - - name: gui checks - run: | - cd gui - npx tsc --noEmit - - - name: binary checks - run: | - cd binary - npx tsc --noEmit - - - name: Run core tests + - name: Run tests run: | cd core npm test - - name: Run gui tests + test-gui: + runs-on: ubuntu-latest + needs: setup + + steps: + - name: Check-out repository + uses: actions/checkout@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - name: Cache GUI dependencies + uses: actions/cache@v3 + id: cache-gui + with: + path: | + node_modules + gui/node_modules + key: ${{ runner.os }}-gui-${{ hashFiles('package-lock.json', 'gui/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-gui- + + - name: Install dependencies + if: steps.cache-gui.outputs.cache-hit != 'true' + run: | + npm ci + cd gui && npm ci + + - name: Run checks run: | cd gui - npm test + npx tsc --noEmit + + - name: Run tests + run: | + cd gui + npm test \ No newline at end of file From 60c32d622e7b6218d66ad878f2295c733d6ec856 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:16:04 -0800 Subject: [PATCH 04/20] test --- .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 869c626aa..5ea1c31bf 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -8,6 +8,7 @@ on: - "extensions/vscode/**" - "core/**" - "gui/**" + - ".github/workflows**" jobs: setup: runs-on: ubuntu-latest @@ -149,4 +150,4 @@ jobs: - name: Run tests run: | cd gui - npm test \ No newline at end of file + npm test From 5eb037e3ae60e9ed987171c89e19311b560dac09 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:22:27 -0800 Subject: [PATCH 05/20] fix --- .github/workflows/pr_checks.yaml | 171 +++++++++++++------------------ 1 file changed, 73 insertions(+), 98 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 5ea1c31bf..84d7b5421 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -4,150 +4,125 @@ on: pull_request: branches: - main + paths: - "extensions/vscode/**" - "core/**" - "gui/**" - ".github/workflows**" + jobs: - setup: + tsc-check: runs-on: ubuntu-latest - outputs: - node-version: ${{ steps.node-setup.outputs.node-version }} steps: + # 1. Check-out repository - name: Check-out repository uses: actions/checkout@v4 + # 2. Install npm dependencies - name: Use Node.js from .nvmrc - id: node-setup uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - test-extension: - runs-on: ubuntu-latest - needs: setup - - steps: - - name: Check-out repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - name: Cache extension dependencies + - name: Cache root node_modules uses: actions/cache@v3 - id: cache-extension with: - path: | - node_modules - extensions/vscode/node_modules - key: ${{ runner.os }}-ext-${{ hashFiles('package-lock.json', 'extensions/vscode/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-ext- + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} - - name: Install dependencies - if: steps.cache-extension.outputs.cache-hit != 'true' + - name: Cache extension node_modules + uses: actions/cache@v3 + with: + path: extensions/vscode/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }} + + - name: Cache core node_modules + uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }} + + - name: Cache gui node_modules + uses: actions/cache@v3 + with: + path: gui/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} + + - name: Cache binary node_modules + uses: actions/cache@v3 + with: + path: binary/node_modules + key: ${{ runner.os }}-node-${{ hashFiles('binary/package-lock.json') }} + + - name: root install run: | npm ci - cd extensions/vscode && npm ci + + - name: extensions/vscode install + run: | + cd extensions/vscode + npm ci env: + # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - - name: Run checks + - name: core install + run: | + cd core + npm ci + + - name: gui install + run: | + cd gui + npm ci + + - name: binary install + run: | + cd binary + npm ci + + - name: extensions/vscode checks run: | cd extensions/vscode npx tsc --noEmit npm run lint - - name: Run e2e tests + - name: Install Xvfb for Linux and run end to end tests run: | - sudo apt-get install -y xvfb - Xvfb :99 & - export DISPLAY=:99 + sudo apt-get install -y xvfb # Install Xvfb + Xvfb :99 & # Start Xvfb + export DISPLAY=:99 # Export the display number to the environment cd extensions/vscode npm run package npm run e2e:ci - test-core: - runs-on: ubuntu-latest - needs: setup - - steps: - - name: Check-out repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - name: Cache core dependencies - uses: actions/cache@v3 - id: cache-core - with: - path: | - node_modules - core/node_modules - key: ${{ runner.os }}-core-${{ hashFiles('package-lock.json', 'core/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-core- - - - name: Install dependencies - if: steps.cache-core.outputs.cache-hit != 'true' - run: | - npm ci - cd core && npm ci - - name: Run checks + - name: core checks run: | cd core + npm ci npx tsc --noEmit npm run lint env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - name: Run tests - run: | - cd core - npm test - test-gui: - runs-on: ubuntu-latest - needs: setup - - steps: - - name: Check-out repository - uses: actions/checkout@v4 - - - name: Setup Node.js - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - name: Cache GUI dependencies - uses: actions/cache@v3 - id: cache-gui - with: - path: | - node_modules - gui/node_modules - key: ${{ runner.os }}-gui-${{ hashFiles('package-lock.json', 'gui/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-gui- - - - name: Install dependencies - if: steps.cache-gui.outputs.cache-hit != 'true' - run: | - npm ci - cd gui && npm ci - - - name: Run checks + - name: gui checks run: | cd gui npx tsc --noEmit - - name: Run tests + - name: binary checks + run: | + cd binary + npx tsc --noEmit + + - name: Run core tests + run: | + cd core + npm test + + - name: Run gui tests run: | cd gui npm test From fb9de703722f188108fec17ab32cf9ca9aa323d1 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:34:41 -0800 Subject: [PATCH 06/20] improv: remove unused step --- .github/workflows/pr_checks.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 84d7b5421..f385e1d33 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -101,7 +101,6 @@ jobs: - name: core checks run: | cd core - npm ci npx tsc --noEmit npm run lint env: From a782455f316ef0763e5e634c6d82bbaaabd7ee08 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:42:12 -0800 Subject: [PATCH 07/20] test: parallelization --- .github/workflows/pr_checks.yaml | 184 +++++++++++++++++++------------ 1 file changed, 114 insertions(+), 70 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index f385e1d33..dfff0fa90 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -4,7 +4,6 @@ on: pull_request: branches: - main - paths: - "extensions/vscode/**" - "core/**" @@ -12,93 +11,57 @@ on: - ".github/workflows**" jobs: - tsc-check: + vscode-checks: runs-on: ubuntu-latest - steps: - # 1. Check-out repository - - name: Check-out repository - uses: actions/checkout@v4 - - # 2. Install npm dependencies - - name: Use Node.js from .nvmrc - uses: actions/setup-node@v4 + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - - name: Cache root node_modules - uses: actions/cache@v3 + - uses: actions/cache@v3 with: - path: node_modules - key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }} + path: | + node_modules + extensions/vscode/node_modules + key: ${{ runner.os }}-node-vscode-${{ hashFiles('package-lock.json', 'extensions/vscode/package-lock.json') }} - - name: Cache extension node_modules - uses: actions/cache@v3 - with: - path: extensions/vscode/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('extensions/vscode/package-lock.json') }} - - - name: Cache core node_modules - uses: actions/cache@v3 - with: - path: core/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('core/package-lock.json') }} - - - name: Cache gui node_modules - uses: actions/cache@v3 - with: - path: gui/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('gui/package-lock.json') }} - - - name: Cache binary node_modules - uses: actions/cache@v3 - with: - path: binary/node_modules - key: ${{ runner.os }}-node-${{ hashFiles('binary/package-lock.json') }} - - - name: root install + - name: Install dependencies run: | npm ci - - - name: extensions/vscode install - run: | cd extensions/vscode npm ci env: - # https://github.com/microsoft/vscode-ripgrep/issues/9#issuecomment-643965333 GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - - name: core install - run: | - cd core - npm ci - - - name: gui install - run: | - cd gui - npm ci - - - name: binary install - run: | - cd binary - npm ci - - - name: extensions/vscode checks + - name: Type check and lint run: | cd extensions/vscode npx tsc --noEmit npm run lint - - name: Install Xvfb for Linux and run end to end tests - run: | - sudo apt-get install -y xvfb # Install Xvfb - Xvfb :99 & # Start Xvfb - export DISPLAY=:99 # Export the display number to the environment - cd extensions/vscode - npm run package - npm run e2e:ci + core-checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" - - name: core checks + - uses: actions/cache@v3 + with: + path: | + node_modules + core/node_modules + key: ${{ runner.os }}-node-core-${{ hashFiles('package-lock.json', 'core/package-lock.json') }} + + - name: Install dependencies + run: | + npm ci + cd core + npm ci + + - name: Type check and lint run: | cd core npx tsc --noEmit @@ -106,16 +69,97 @@ jobs: env: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} - - name: gui checks + gui-checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: | + node_modules + gui/node_modules + key: ${{ runner.os }}-node-gui-${{ hashFiles('package-lock.json', 'gui/package-lock.json') }} + + - name: Install dependencies + run: | + npm ci + cd gui + npm ci + + - name: Type check run: | cd gui npx tsc --noEmit - - name: binary checks + binary-checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: | + node_modules + binary/node_modules + key: ${{ runner.os }}-node-binary-${{ hashFiles('package-lock.json', 'binary/package-lock.json') }} + + - name: Install dependencies + run: | + npm ci + cd binary + npm ci + + - name: Type check run: | cd binary npx tsc --noEmit + tests: + needs: [vscode-checks, core-checks, gui-checks, binary-checks] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: | + node_modules + extensions/vscode/node_modules + core/node_modules + gui/node_modules + key: ${{ runner.os }}-node-tests-${{ hashFiles('package-lock.json', '**/package-lock.json') }} + + - name: Install dependencies + run: | + npm ci + cd extensions/vscode && npm ci + cd ../core && npm ci + cd ../gui && npm ci + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + + - name: Install and setup Xvfb + run: | + sudo apt-get install -y xvfb + Xvfb :99 & + export DISPLAY=:99 + + - name: Run VSCode e2e tests + run: | + cd extensions/vscode + npm run package + npm run e2e:ci + - name: Run core tests run: | cd core From 1bb1d71565a244c7baebcae78c651a3fb1d8d512 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:44:47 -0800 Subject: [PATCH 08/20] test: more parellelization --- .github/workflows/pr_checks.yaml | 81 +++++++++++++++++--------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index dfff0fa90..8c578b120 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -11,24 +11,38 @@ on: - ".github/workflows**" jobs: - vscode-checks: + install-root: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: - path: | - node_modules - extensions/vscode/node_modules - key: ${{ runner.os }}-node-vscode-${{ hashFiles('package-lock.json', 'extensions/vscode/package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies + - name: Install root dependencies + run: npm ci + + vscode-checks: + needs: install-root + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + + - name: Install vscode dependencies run: | - npm ci cd extensions/vscode npm ci env: @@ -41,23 +55,21 @@ jobs: npm run lint core-checks: + needs: install-root runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: - path: | - node_modules - core/node_modules - key: ${{ runner.os }}-node-core-${{ hashFiles('package-lock.json', 'core/package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies + - name: Install core dependencies run: | - npm ci cd core npm ci @@ -70,23 +82,21 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} gui-checks: + needs: install-root runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: - path: | - node_modules - gui/node_modules - key: ${{ runner.os }}-node-gui-${{ hashFiles('package-lock.json', 'gui/package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies + - name: Install gui dependencies run: | - npm ci cd gui npm ci @@ -96,23 +106,21 @@ jobs: npx tsc --noEmit binary-checks: + needs: install-root runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: - path: | - node_modules - binary/node_modules - key: ${{ runner.os }}-node-binary-${{ hashFiles('package-lock.json', 'binary/package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies + - name: Install binary dependencies run: | - npm ci cd binary npm ci @@ -129,19 +137,14 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: - path: | - node_modules - extensions/vscode/node_modules - core/node_modules - gui/node_modules - key: ${{ runner.os }}-node-tests-${{ hashFiles('package-lock.json', '**/package-lock.json') }} + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install dependencies + - name: Install all test dependencies run: | - npm ci cd extensions/vscode && npm ci cd ../core && npm ci cd ../gui && npm ci @@ -168,4 +171,4 @@ jobs: - name: Run gui tests run: | cd gui - npm test + npm test \ No newline at end of file From 5797c803026eb8093f825c73926182f0ce9e7d3a Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:52:55 -0800 Subject: [PATCH 09/20] test --- .github/workflows/pr_checks.yaml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 8c578b120..53c8ee0ea 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -106,6 +106,29 @@ jobs: npx tsc --noEmit binary-checks: + needs: [install-root, core-checks] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + + - name: Install binary dependencies + run: | + cd binary + npm ci + + - name: Type check + run: | + cd binary + npx tsc --noEmit + needs: install-root runs-on: ubuntu-latest steps: From 8f2419740044a5df2ca70905c2b9ecd0fef3389e Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 10:56:40 -0800 Subject: [PATCH 10/20] fix: binary --- .github/workflows/pr_checks.yaml | 35 ++++++-------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 53c8ee0ea..2b2c32968 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -18,7 +18,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: path: node_modules @@ -35,7 +35,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: path: node_modules @@ -62,7 +62,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: path: node_modules @@ -89,7 +89,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: path: node_modules @@ -113,30 +113,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - - - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - name: Install binary dependencies - run: | - cd binary - npm ci - - - name: Type check - run: | - cd binary - npx tsc --noEmit - - needs: install-root - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - uses: actions/cache@v3 with: path: node_modules @@ -160,7 +137,7 @@ jobs: - uses: actions/setup-node@v4 with: node-version-file: ".nvmrc" - + - uses: actions/cache@v3 with: path: node_modules @@ -194,4 +171,4 @@ jobs: - name: Run gui tests run: | cd gui - npm test \ No newline at end of file + npm test From e5fb4f17ad9d3b6e72d6c7e0920357e607c0e776 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:14:06 -0800 Subject: [PATCH 11/20] fix: workflow --- .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 2b2c32968..5ea57342d 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -82,7 +82,7 @@ jobs: OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} gui-checks: - needs: install-root + needs: [install-root, core-checks] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 From 990709c353fdc842bab5d01bd7b995fbcc970666 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:16:47 -0800 Subject: [PATCH 12/20] test --- .github/workflows/pr_checks.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 5ea57342d..e20aa7f90 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -95,6 +95,11 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + - name: Install core dependencies + run: | + cd core + npm ci + - name: Install gui dependencies run: | cd gui From a62fa9df26b5fdb3847ea17267de7cb0fc0b8d87 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:20:07 -0800 Subject: [PATCH 13/20] test: core --- .github/workflows/pr_checks.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index e20aa7f90..989cc3950 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -68,6 +68,11 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + - uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - name: Install core dependencies run: | cd core @@ -95,6 +100,11 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + - uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - name: Install core dependencies run: | cd core From 05958f4b4fb68da9f67f261159c82802860050a1 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:25:58 -0800 Subject: [PATCH 14/20] test: gui --- .github/workflows/pr_checks.yaml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 989cc3950..5c4ea8418 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -105,11 +105,6 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - name: Install core dependencies - run: | - cd core - npm ci - - name: Install gui dependencies run: | cd gui From 9330af6a8cd03d1f2b9d70de33a68692a077a1c2 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:29:27 -0800 Subject: [PATCH 15/20] ci: binary --- .github/workflows/pr_checks.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 5c4ea8418..78ee1e496 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -129,6 +129,11 @@ jobs: path: node_modules key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + - uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - name: Install binary dependencies run: | cd binary From eaa8a2cb50287fe19e29b4a96fc8d8df877a362b Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:34:27 -0800 Subject: [PATCH 16/20] ci: vscode-checks fix --- .github/workflows/pr_checks.yaml | 59 +++++++++++++++++--------------- 1 file changed, 32 insertions(+), 27 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 78ee1e496..477705292 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -27,33 +27,6 @@ jobs: - name: Install root dependencies run: npm ci - vscode-checks: - needs: install-root - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version-file: ".nvmrc" - - - uses: actions/cache@v3 - with: - path: node_modules - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} - - - name: Install vscode dependencies - run: | - cd extensions/vscode - npm ci - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - - - name: Type check and lint - run: | - cd extensions/vscode - npx tsc --noEmit - npm run lint - core-checks: needs: install-root runs-on: ubuntu-latest @@ -144,6 +117,38 @@ jobs: cd binary npx tsc --noEmit + vscode-checks: + needs: [install-root, core-checks] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: node_modules + key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + + - uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + + - name: Install vscode dependencies + run: | + cd extensions/vscode + npm ci + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + + - name: Type check and lint + run: | + cd extensions/vscode + npx tsc --noEmit + npm run lint + tests: needs: [vscode-checks, core-checks, gui-checks, binary-checks] runs-on: ubuntu-latest From 047ff1e44739f29eb8d9d83b85cff76f8eb397d1 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:43:32 -0800 Subject: [PATCH 17/20] ci: add caching --- .github/workflows/pr_checks.yaml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 477705292..a948faf97 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -78,6 +78,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v3 + with: + path: gui/node_modules + key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} + - name: Install gui dependencies run: | cd gui @@ -107,6 +112,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v3 + with: + path: binary/node_modules + key: ${{ runner.os }}-binary-node-modules-${{ hashFiles('binary/package-lock.json') }} + - name: Install binary dependencies run: | cd binary @@ -136,6 +146,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + - uses: actions/cache@v3 + with: + path: extensions/vscode/node_modules + key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} + - name: Install vscode dependencies run: | cd extensions/vscode From 82daef93471dccd4dcfcbfe7e958722dab4a2eca Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:53:38 -0800 Subject: [PATCH 18/20] ci: split tests --- .github/workflows/pr_checks.yaml | 65 ++++++++++++++++++++++++-------- 1 file changed, 50 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index a948faf97..12ec216bf 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -164,8 +164,8 @@ jobs: npx tsc --noEmit npm run lint - tests: - needs: [vscode-checks, core-checks, gui-checks, binary-checks] + core-tests: + needs: [core-checks] runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -175,16 +175,32 @@ jobs: - uses: actions/cache@v3 with: - path: node_modules - key: ${{ runner.os }}-root-node-modules-${{ hashFiles('package-lock.json') }} + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('extensions/core/package-lock.json') }} - - name: Install all test dependencies + - name: Run core tests run: | - cd extensions/vscode && npm ci - cd ../core && npm ci - cd ../gui && npm ci - env: - GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} + cd extensions/core + npm test + + vscode-tests: + needs: [vscode-checks, core-checks] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: extensions/vscode/node_modules + key: ${{ runner.os }}-vscode-node-modules-${{ hashFiles('extensions/vscode/package-lock.json') }} + + - uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - name: Install and setup Xvfb run: | @@ -198,12 +214,31 @@ jobs: npm run package npm run e2e:ci - - name: Run core tests - run: | - cd core - npm test + gui-tests: + needs: [gui-checks, core-checks] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + + - uses: actions/cache@v3 + with: + path: gui/node_modules + key: ${{ runner.os }}-gui-node-modules-${{ hashFiles('gui/package-lock.json') }} + + - uses: actions/cache@v3 + with: + path: core/node_modules + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} + + - name: Install GUI dependencies + run: cd extensions/gui && npm ci + env: + GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - name: Run gui tests run: | - cd gui + cd extensions/gui npm test From bb33bbe823b08934f197d4a7bc2a7c97ac7bff71 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 11:58:03 -0800 Subject: [PATCH 19/20] ci: fix dependencies --- .github/workflows/pr_checks.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr_checks.yaml b/.github/workflows/pr_checks.yaml index 12ec216bf..ef31f210d 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -176,11 +176,11 @@ jobs: - uses: actions/cache@v3 with: path: core/node_modules - key: ${{ runner.os }}-core-node-modules-${{ hashFiles('extensions/core/package-lock.json') }} + key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - name: Run core tests run: | - cd extensions/core + cd core npm test vscode-tests: @@ -234,11 +234,11 @@ jobs: key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - name: Install GUI dependencies - run: cd extensions/gui && npm ci + run: cd gui && npm ci env: GITHUB_TOKEN: ${{ secrets.CI_GITHUB_TOKEN }} - name: Run gui tests run: | - cd extensions/gui + cd gui npm test From a7ac6627378a9b5d28851bd0af0c7b04f076d2c0 Mon Sep 17 00:00:00 2001 From: tomasz-io Date: Tue, 10 Dec 2024 12:10:03 -0800 Subject: [PATCH 20/20] ci: vscode e2e --- .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 ef31f210d..b4e0dd677 100644 --- a/.github/workflows/pr_checks.yaml +++ b/.github/workflows/pr_checks.yaml @@ -202,14 +202,11 @@ jobs: path: core/node_modules key: ${{ runner.os }}-core-node-modules-${{ hashFiles('core/package-lock.json') }} - - name: Install and setup Xvfb - run: | - sudo apt-get install -y xvfb - Xvfb :99 & - export DISPLAY=:99 - - - name: Run VSCode e2e tests + - name: Install Xvfb for Linux and run e2e tests run: | + sudo apt-get install -y xvfb # Install Xvfb + Xvfb :99 & # Start Xvfb + export DISPLAY=:99 # Export the display number to the environment cd extensions/vscode npm run package npm run e2e:ci