From 986c84f1d84e8614e071040898638b7debae6c7f Mon Sep 17 00:00:00 2001 From: Davide Carpini Date: Tue, 26 Mar 2024 15:07:05 +0100 Subject: [PATCH] fix: script ci --- .github/workflows/test-e2e.yaml | 68 ++++++++++++++++----------------- package.json | 3 +- tests/e2e/package.json | 3 +- turbo.json | 4 +- 4 files changed, 39 insertions(+), 39 deletions(-) diff --git a/.github/workflows/test-e2e.yaml b/.github/workflows/test-e2e.yaml index c37650e9..05f4ef59 100644 --- a/.github/workflows/test-e2e.yaml +++ b/.github/workflows/test-e2e.yaml @@ -1,44 +1,42 @@ name: E2E Tests on: - push: - branches: [main] - pull_request: - branches: [main] + push: + branches: [main] + pull_request: + branches: [main] concurrency: group: ${{ github.head_ref || github.ref_name }}-e2e-test cancel-in-progress: true jobs: - e2e-tests: - runs-on: ubuntu-latest - name: E2E Tests - - steps: - - name: Install Stable Chrome - run: | - wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - - sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' - sudo apt-get update - sudo apt-get install google-chrome-stable - - - name: Install Stable chromedriver - uses: nanasess/setup-chromedriver@v2 - - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Node - uses: actions/setup-node@v3 - with: - node-version-file: .nvmrc - cache: 'yarn' - - - name: Install - run: yarn install:all - - - name: Run E2E Tests - run: yarn run test:e2e - - + e2e-tests: + runs-on: ubuntu-latest + name: E2E Tests + + steps: + - name: Install Stable Chrome + run: | + wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - + sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' + sudo apt-get update + sudo apt-get install google-chrome-stable + + - name: Install Stable chromedriver + uses: nanasess/setup-chromedriver@v2 + + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version-file: .nvmrc + cache: 'yarn' + + - name: Install + run: yarn install:all + + - name: Run E2E Tests + run: yarn run test:e2e:ci diff --git a/package.json b/package.json index ad6a8fec..b33cb28a 100755 --- a/package.json +++ b/package.json @@ -24,7 +24,8 @@ "purge": "npx turbo@latest run purge && rm -rf node_modules", "reinstall": "yarn clean && yarn purge && yarn && yarn run build:deps", "test": "turbo run test --filter='@vechain/*'", - "test:e2e": "turbo run test:e2e" + "test:e2e": "turbo run test:e2e", + "test:e2e:ci": "turbo run test:e2e:ci" }, "husky": { "hooks": { diff --git a/tests/e2e/package.json b/tests/e2e/package.json index 342d4b81..5aa3e8b6 100644 --- a/tests/e2e/package.json +++ b/tests/e2e/package.json @@ -7,7 +7,8 @@ "main": "index.js", "scripts": { "test:debug": "DEBUG=cucumber yarn test", - "test:e2e": "SELENIUM_HEADLESS=true cucumber-js" + "test:e2e": "cucumber-js", + "test:e2e:ci": "SELENIUM_HEADLESS=true cucumber-js" }, "dependencies": {}, "devDependencies": { diff --git a/turbo.json b/turbo.json index 5c685dd2..affb7b57 100644 --- a/turbo.json +++ b/turbo.json @@ -13,10 +13,10 @@ "dependsOn": ["build"] }, "preview": { - "dependsOn": ["build"] + "dependsOn": ["^preview", "build"] }, "test:e2e": { - "dependsOn": ["preview"] + "dependsOn": ["preview", "build"] }, "lint": {}, "dev": {