diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 617e8f86903..60bc584d393 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,24 +1,63 @@ name: Release packages (Work in Progress, a dry run only) +run-name: "Create ${{ inputs.type }} release from ${{ inputs.release_ref }} by ${{ github.actor }}" on: workflow_dispatch: inputs: + release_ref: + description: Upstream git ref to create the release from + required: true + type: string + type: + description: Release type + required: true + type: choice + options: + - snapshot + - official workspaces: description: A comma-separated list of workspaces to release required: false type: string + dry_run: + description: Dry run (do not publish the packages) + required: true + type: boolean #permissions: # id-token: write # Required for OIDC # contents: read jobs: - checks: - name: Checks + lint_and_unit_tests: + name: Run lint and unit tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ inputs.release_ref }} + persist-credentials: false + - uses: actions/setup-node@v6 + with: + node-version-file: .nvmrc + cache: yarn + - name: Install dependencies + run: yarn install --immutable + - name: Build local packages + run: yarn workspaces foreach --all --parallel --topological-dev --exclude @elastic/eui-website --exclude @elastic/eui-monorepo --exclude @elastic/eui-docgen run build + # TODO: Uncomment when code formatting is fixed in eui-theme-common and eui-theme-borealis + # This is prepared in the upstream/build/gh-release-action branch + # - name: Lint + # run: yarn workspaces foreach --all --parallel --topological-dev --exclude @elastic/eui-website --exclude @elastic/eui-monorepo --exclude @elastic/eui-docgen run lint + - name: Unit tests + run: yarn workspaces foreach --all --parallel --topological-dev --exclude @elastic/eui-website --exclude @elastic/eui-monorepo --exclude @elastic/eui-docgen run test-unit + cypress_tests: + name: Run cypress tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: + ref: ${{ inputs.release_ref }} persist-credentials: false - uses: actions/setup-node@v6 with: @@ -26,5 +65,7 @@ jobs: cache: yarn - name: Install dependencies run: yarn install --immutable - - name: Run tests - run: yarn workspaces foreach -A run test-ci + - name: Build local packages + run: yarn workspaces foreach --all --parallel --topological-dev --exclude @elastic/eui-website --exclude @elastic/eui-monorepo --exclude @elastic/eui-docgen run build + - name: Cypress tests + run: yarn workspaces foreach --all --parallel --topological-dev --exclude @elastic/eui-website --exclude @elastic/eui-monorepo --exclude @elastic/eui-docgen run test-cypress diff --git a/package.json b/package.json index 724a725a0e9..b19900d7b99 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,6 @@ }, "scripts": { "pre-push": "yarn --cwd packages/eui pre-push", - "preinstall": "printf $'\\x1b[K\\x1b[37;41mWarning: EUI has recently migrated to a monorepo structure. Please run EUI scripts like \\x1b[1;4myarn start\\x1b[0m\\x1b[37;41m or \\x1b[1;4myarn build\\x1b[0m\\x1b[37;41m from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead!\\n\\nIf this is the first time you\\'re running EUI after the monorepo migration, please run this first from the root repository\\'s directory to clean up your local environment:\\n \\x1b[1;4mrm -rf node_modules .cache-loader dist es lib optimize test-env types .eslintcache .loki reports docs .nyc_output eui.d.ts && yarn\\x1b[0m\\x1b[37;41m\\n\\nInstall process will continue in 10 seconds...\\x1b[0m'; sleep 10", "start": "printf $'\\x1b[K\\x1b[37;41mPlease run this script from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead\\x1b[0m\\n'; exit 1", "build": "printf $'\\x1b[K\\x1b[37;41mPlease run this script from the \\x1b[1;4mpackages/eui\\x1b[0m\\x1b[37;41m directory instead\\x1b[0m\\n'; exit 1", "release": "node scripts/release", diff --git a/packages/eslint-plugin/package.json b/packages/eslint-plugin/package.json index 9d2ad5044ea..19540988127 100644 --- a/packages/eslint-plugin/package.json +++ b/packages/eslint-plugin/package.json @@ -43,7 +43,8 @@ "typescript": "^5.8.3" }, "scripts": { - "test": "jest src", + "test": "yarn test-unit", + "test-unit": "jest src", "build": "yarn build:clean && yarn build:compile && yarn build:compile:esm && yarn build:types", "build:clean": "rimraf lib/", "build:compile:esm": "tsc --project ./tsconfig.esm.json", diff --git a/packages/eui-theme-borealis/package.json b/packages/eui-theme-borealis/package.json index da94c535cbe..f4278139e82 100644 --- a/packages/eui-theme-borealis/package.json +++ b/packages/eui-theme-borealis/package.json @@ -15,7 +15,8 @@ "lint": "yarn tsc --noEmit && yarn lint-es && yarn lint-sass", "lint-es": "eslint --cache src/**/*.ts --max-warnings 0", "lint-sass": "yarn stylelint \"**/*.scss\" --quiet-deprecation-warnings", - "test": "jest ./src", + "test": "yarn test-unit", + "test-unit": "jest ./src --passWithNoTests", "pre-push": "yarn build:workspaces && yarn lint && yarn test" }, "repository": { diff --git a/packages/eui-theme-common/package.json b/packages/eui-theme-common/package.json index d34dfc6f158..3b9469682f2 100644 --- a/packages/eui-theme-common/package.json +++ b/packages/eui-theme-common/package.json @@ -13,7 +13,8 @@ "lint": "yarn tsc --noEmit && yarn lint-es && yarn lint-sass", "lint-es": "eslint --cache src/**/*.ts --max-warnings 0", "lint-sass": "yarn stylelint \"**/*.scss\" --quiet-deprecation-warnings", - "test": "jest ./src", + "test": "yarn test-unit", + "test-unit": "jest ./src --passWithNoTests", "pre-push": "yarn lint && yarn test" }, "repository": { diff --git a/packages/release-cli/package.json b/packages/release-cli/package.json index fb9fcbf2199..7b1d0149881 100644 --- a/packages/release-cli/package.json +++ b/packages/release-cli/package.json @@ -5,7 +5,6 @@ "description": "", "main": "dist/index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", "build": "tsc" }, "repository": {