From b69208a7a4631e416d44b9f9b1fa9b6820f9a884 Mon Sep 17 00:00:00 2001 From: Nacho Vazquez Date: Tue, 28 May 2024 17:26:41 -0300 Subject: [PATCH] fix: adjust cypress config --- .github/workflows/ci.yml | 15 +++++++-- .../lumberjack-app-e2e/.eslintrc.json | 7 ---- .../lumberjack-app-e2e/cypress.config.ts | 10 +++++- e2e/examples/lumberjack-app-e2e/project.json | 32 +------------------ e2e/examples/lumberjack-app-e2e/tsconfig.json | 9 ++---- nx.json | 1 - 6 files changed, 24 insertions(+), 50 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 602990b8e..3c784e569 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,6 +6,10 @@ on: - main pull_request: {} +permissions: + actions: read + contents: read + concurrency: # Group concurrency on workflow, then: # - Is merge run? Group on branch name (`refs/heads/main`) @@ -35,10 +39,15 @@ jobs: # The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested # - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build" - - name: Setup - uses: ./.github/actions/setup + - uses: pnpm/action-setup@v2 + with: + version: 8 + # Cache node_modules + - uses: actions/setup-node@v4 with: - git_bot_token: ${{ secrets.GIT_BOT_TOKEN }} + node-version: 20 + cache: 'pnpm' + - run: pnpm install --frozen-lockfile - uses: nrwl/nx-set-shas@v4 diff --git a/e2e/examples/lumberjack-app-e2e/.eslintrc.json b/e2e/examples/lumberjack-app-e2e/.eslintrc.json index e4eb8d11c..3947051c7 100644 --- a/e2e/examples/lumberjack-app-e2e/.eslintrc.json +++ b/e2e/examples/lumberjack-app-e2e/.eslintrc.json @@ -5,13 +5,6 @@ { "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], "rules": {} - }, - { - "files": ["src/plugins/index.js"], - "rules": { - "@typescript-eslint/no-var-requires": "off", - "no-undef": "off" - } } ] } diff --git a/e2e/examples/lumberjack-app-e2e/cypress.config.ts b/e2e/examples/lumberjack-app-e2e/cypress.config.ts index 875eddc02..87c5de471 100644 --- a/e2e/examples/lumberjack-app-e2e/cypress.config.ts +++ b/e2e/examples/lumberjack-app-e2e/cypress.config.ts @@ -3,6 +3,14 @@ import { defineConfig } from 'cypress'; export default defineConfig({ e2e: { - ...nxE2EPreset(__dirname), + ...nxE2EPreset(__filename, { + cypressDir: 'src', + webServerCommands: { + default: 'nx run examples-lumberjack-app:serve:development', + production: 'nx run examples-lumberjack-app:serve:production', + }, + ciWebServerCommand: 'nx run examples-lumberjack-app:serve-static', + }), + baseUrl: 'http://localhost:4200', }, }); diff --git a/e2e/examples/lumberjack-app-e2e/project.json b/e2e/examples/lumberjack-app-e2e/project.json index 99e6c854c..df3cc18ac 100644 --- a/e2e/examples/lumberjack-app-e2e/project.json +++ b/e2e/examples/lumberjack-app-e2e/project.json @@ -5,35 +5,5 @@ "projectType": "application", "tags": ["scope:internal", "type:e2e"], "implicitDependencies": ["examples-lumberjack-app"], - "targets": { - "e2e": { - "executor": "@nx/cypress:cypress", - "dependsOn": [ - { - "target": "build", - "dependencies": true - } - ], - "options": { - "cypressConfig": "e2e/examples/lumberjack-app-e2e/cypress.config.ts", - "devServerTarget": "examples-lumberjack-app:serve:development", - "testingType": "e2e" - }, - "configurations": { - "production": { - "devServerTarget": "examples-lumberjack-app:serve:production" - } - } - }, - "lint": { - "executor": "@nx/eslint:lint", - "configurations": { - "report": { - "format": "json", - "force": true, - "outputFile": "reports/e2e/examples/lumberjack-app-e2e/lint/report.json" - } - } - } - } + "targets": {} } diff --git a/e2e/examples/lumberjack-app-e2e/tsconfig.json b/e2e/examples/lumberjack-app-e2e/tsconfig.json index 0f3eb22c9..5dbcd2f3c 100644 --- a/e2e/examples/lumberjack-app-e2e/tsconfig.json +++ b/e2e/examples/lumberjack-app-e2e/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../../tsconfig.base.json", "compilerOptions": { + "module": "commonjs", "sourceMap": false, "outDir": "../../../dist/out-tsc", "allowJs": true, @@ -12,11 +13,5 @@ "noImplicitReturns": true, "noFallthroughCasesInSwitch": true }, - "include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"], - "angularCompilerOptions": { - "enableI18nLegacyMessageIdFormat": false, - "strictInjectionParameters": true, - "strictInputAccessModifiers": true, - "strictTemplates": true - } + "include": ["src/**/*.ts", "src/**/*.js", "cypress.config.ts"] } diff --git a/nx.json b/nx.json index 8bfe77350..935e25f9b 100644 --- a/nx.json +++ b/nx.json @@ -79,6 +79,5 @@ "projectSpecificFiles": [] }, "nxCloudAccessToken": "M2I0MTZlMmMtYmQ5ZC00ZDg1LWFjOTQtZjU5ZGFkYWM3YjM2fHJlYWQ=", - "useInferencePlugins": false, "defaultBase": "main" }