Skip to content

Commit

Permalink
fix CS CI (#1089)
Browse files Browse the repository at this point in the history
* fix CS CI - pnpm 8

* install-chrome 2

* fix

* tasks

* pnpm 9

* last fix

* pnpm 9

* .
  • Loading branch information
ukrbublik authored Jul 12, 2024
1 parent cf87d44 commit 7057376
Show file tree
Hide file tree
Showing 3 changed files with 105 additions and 3 deletions.
90 changes: 90 additions & 0 deletions .codesandbox/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
// These tasks will run in order when initializing your CodeSandbox project.
"setupTasks": [
{
"name": "Install pnpm 9",
"command": "npm i -g pnpm@9"
},
{
"name": "Install dependencies",
"command": "pnpm install --frozen-lockfile"
},
{
"name": "Install Chrome",
"command": "export CHROME_BIN=$(./packages/tests/node_modules/.bin/puppeteer browsers install chrome@115 | cut -d' ' -f2)"
}
],

// These tasks can be run from CodeSandbox. Running one will open a log in the app.
"tasks": {
"start": {
"name": "start",
"command": "pnpm start",
"runAtStart": true,
"preview": {
"port": 3001
}
},
"test": {
"name": "test",
"command": "pnpm test"
},
"test-dev": {
"name": "test-dev",
"command": "pnpm test-dev"
},
"lint": {
"name": "lint",
"command": "pnpm lint"
},
"lint-fix": {
"name": "lint-fix",
"command": "pnpm lint-fix"
},
"build": {
"name": "build",
"command": "pnpm build"
},
"build-examples": {
"name": "build-examples",
"command": "pnpm build-examples"
},
"build-libs": {
"name": "build-libs",
"command": "pnpm build-libs"
},
"sandbox-js": {
"name": "sandbox-js",
"command": "pnpm sandbox-js",
"preview": {
"port": 5174
}
},
"sandbox-next": {
"name": "sandbox-next",
"command": "pnpm sandbox-next",
"preview": {
"port": 3002
}
},
"sandbox-ts": {
"name": "sandbox-ts",
"command": "pnpm sandbox-ts",
"preview": {
"port": 5175
}
},
"clean": {
"name": "clean",
"command": "pnpm clean"
},
"smoke": {
"name": "smoke",
"command": "pnpm smoke"
},
"resmoke": {
"name": "resmoke",
"command": "pnpm resmoke"
}
}
}
6 changes: 3 additions & 3 deletions packages/tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"eslint": "eslint --ext .jsx --ext .js --ext .tsx --ext .ts ./specs/ ./support/",
"lint": "npm run eslint && npm run tsc",
"lint-fix": "eslint --ext .jsx --ext .js --ext .tsx --ext .ts --fix ./specs/ ./support/",
"test": "karma start ./karma.conf.js",
"test-debug": "TEST_WATCH=1 TEST_DEBUG=1 karma start ./karma.conf.js --debug",
"test-dev": "TEST_WATCH=1 karma start ./karma.conf.js",
"test": ". ./scripts/install-chrome.sh && karma start ./karma.conf.js",
"test-debug": ". ./scripts/install-chrome.sh && TEST_WATCH=1 TEST_DEBUG=1 karma start ./karma.conf.js --debug",
"test-dev": ". ./scripts/install-chrome.sh && TEST_WATCH=1 karma start ./karma.conf.js",
"tsc": "tsc -p . --noEmit"
},
"dependencies": {
Expand Down
12 changes: 12 additions & 0 deletions packages/tests/scripts/install-chrome.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

if [ "$CSB" = "true" ]; then
echo "CHROME_BIN=$CHROME_BIN"
PUPPETEER_VERSION=$(./node_modules/.bin/puppeteer --version)
echo "puppeteer version: $PUPPETEER_VERSION"
INSTALL_RES=$(./node_modules/.bin/puppeteer browsers install chrome@115)
echo "install result: $INSTALL_RES"
INSTALL_PATH=$(echo $INSTALL_RES | cut -d' ' -f2)
echo "install path: $INSTALL_PATH"
export CHROME_BIN="$INSTALL_PATH"
fi

0 comments on commit 7057376

Please sign in to comment.