Skip to content

Commit

Permalink
Merge branch 'main' into feature/publish-throttle
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesHenry committed Jun 7, 2024
2 parents e3d5ea2 + d9b15c8 commit acd2760
Show file tree
Hide file tree
Showing 16 changed files with 781 additions and 741 deletions.
27 changes: 22 additions & 5 deletions .github/actions/install-node-and-dependencies/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ runs:
using: "composite"
steps:
- name: Install node and npm based on the given values (or the volta config in package.json)
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version-file: ${{ inputs.node-version == '' && 'package.json' || '' }}
node-version: ${{ inputs.node-version }}
Expand All @@ -28,21 +28,38 @@ runs:
- name: Enable corepack
run: corepack enable
shell: bash
env:
COREPACK_ENABLE_AUTO_PIN: "0"
COREPACK_ENABLE_STRICT: "0"

- name: Install pnpm v8
run: corepack install -g pnpm@8
shell: bash
env:
COREPACK_ENABLE_AUTO_PIN: "0"

- name: Print installed pnpm version
run: pnpm --version
shell: bash
COREPACK_ENABLE_STRICT: "0"

- name: Use Yarn classic
run: yarn set version classic
shell: bash
env:
COREPACK_ENABLE_AUTO_PIN: "0"
COREPACK_ENABLE_STRICT: "0"

- name: Print installed node, npm, yarn and pnpm versions
run: |
node --version
npm --version
yarn --version
pnpm --version
shell: bash
env:
COREPACK_ENABLE_AUTO_PIN: "0"
COREPACK_ENABLE_STRICT: "0"

- name: Install dependencies
run: ${{ inputs.install-command }}
shell: bash
env:
COREPACK_ENABLE_AUTO_PIN: "0"
COREPACK_ENABLE_STRICT: "0"
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ concurrency:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_VERBOSE_LOGGING: false

jobs:
Expand Down
31 changes: 16 additions & 15 deletions .github/workflows/other-node-versions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ concurrency:

env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
NX_CLOUD_DISTRIBUTED_EXECUTION: true
NX_VERBOSE_LOGGING: false
COREPACK_ENABLE_AUTO_PIN: "0"
COREPACK_ENABLE_STRICT: "0"
Expand Down Expand Up @@ -48,8 +47,6 @@ jobs:
with:
fetch-depth: 0

- uses: nrwl/nx-set-shas@v4

- name: Install node v${{ matrix.node }} and dependencies
uses: ./.github/actions/install-node-and-dependencies
with:
Expand All @@ -68,20 +65,14 @@ jobs:
run: corepack install -g pnpm@8
shell: bash

- name: Print installed pnpm version
run: pnpm --version
- name: Print installed node, npm, yarn and pnpm versions
run: |
node --version
npm --version
yarn --version
pnpm --version
shell: bash

- name: Run parallel distributed builds and tests on each node version
uses: jameshenry/parallel-bash-commands@v1
with:
cmd1: npx nx run-many -t build --parallel=3
cmd2: npx nx run-many -t test --parallel=3 --ci --maxWorkers=2
cmd3: npx nx run integration:integration --ci --maxWorkers=2

# e2e tests for everything except the primary task runner
- run: PUBLISHED_VERSION=999.9.9-e2e.0 npx nx run-many --t e2e --parallel=1

- name: Configure git metadata
run: |
git config --global user.email test@example.com
Expand Down Expand Up @@ -116,6 +107,16 @@ jobs:
git config tag.gpgsign true
git config --global user.signingkey $GPG_KEY_ID
- name: Run parallel distributed builds and tests on each node version
uses: jameshenry/parallel-bash-commands@v1
with:
cmd1: npx nx run-many -t build --parallel=3
cmd2: npx nx run-many -t test --parallel=3 --ci --maxWorkers=2
cmd3: npx nx run integration:integration --ci --maxWorkers=2

# e2e tests for everything except the primary task runner
- run: PUBLISHED_VERSION=999.9.9-e2e.0 npx nx run-many --t e2e --parallel=1

- name: Run e2e tests for task-runner
run: |
# We do not want the automatic Github Actions grouping to be applied to the e2e tests, or the snapshots won't match local
Expand Down
186 changes: 94 additions & 92 deletions e2e/publish/src/custom-publish-directories.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fixture, normalizeCommitSHAs, normalizeEnvironment } from "@lerna/e2e-utils";
import { Fixture, normalizeCommitSHAs, normalizeEnvironment, trimEnds } from "@lerna/e2e-utils";
import { ensureDir, writeFile } from "fs-extra";
import globby from "globby";

Expand All @@ -7,15 +7,17 @@ const randomVersion = () => `${randomInt(10, 89)}.${randomInt(10, 89)}.${randomI

expect.addSnapshotSerializer({
serialize(str: string) {
return normalizeCommitSHAs(normalizeEnvironment(str))
.replaceAll(/integrity:\s*.*/g, "integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
.replaceAll(/\d*\.\d*\s?kB package\.json/g, "XXXkb package.json")
.replaceAll(/\d*B package\.json/g, "XXXB package.json")
.replaceAll(/\d*\.\d*\s?kB/g, "XXX.XXX kb")
.replaceAll(/size:\s*\d*\s?B/g, "size: XXXB")
.replaceAll(/session\s\w{16}/g, "session XXXXXXXX")
.replaceAll(/"vXX\.XX\.XX-0-g[a-f0-9]{7}"/g, '"vXX.XX.XX-0-gXXXXXXXX"')
.replaceAll(/node@v\d+\.\d+\.\d+\+\w+ \(\w+\)/g, "<user agent>");
return trimEnds(
normalizeCommitSHAs(normalizeEnvironment(str))
.replaceAll(/integrity:\s*.*/g, "integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX")
.replaceAll(/\d*\.\d*\s?kB package\.json/g, "XXXkb package.json")
.replaceAll(/\d*B package\.json/g, "XXXB package.json")
.replaceAll(/\d*\.\d*\s?kB/g, "XXX.XXX kb")
.replaceAll(/size:\s*\d*\s?B/g, "size: XXXB")
.replaceAll(/session\s\w{16}/g, "session XXXXXXXX")
.replaceAll(/"vXX\.XX\.XX-0-g[a-f0-9]{7}"/g, '"vXX.XX.XX-0-gXXXXXXXX"')
.replaceAll(/node@v\d+\.\d+\.\d+\+\w+ \(\w+\)/g, "<user agent>")
);
},
test(val: string) {
return val != null && typeof val === "string";
Expand Down Expand Up @@ -136,7 +138,7 @@ describe("lerna-publish-custom-publish-directories", () => {
- package-2 => XX.XX.XX
- package-3 => XX.XX.XX
lerna info auto-confirmed
lerna info auto-confirmed
lerna info publish Publishing packages to npm...
lerna notice Skipping all user and access validation due to third-party registry
lerna notice Make sure you're authenticated properly ¯\\_(ツ)_/¯
Expand All @@ -162,56 +164,56 @@ describe("lerna-publish-custom-publish-directories", () => {
lerna verb packed packages/package-3
lerna verb publish package-1
lerna success published package-1 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice XXXkb package.json
lerna notice === Tarball Details ===
lerna notice name: package-1
lerna notice version: XX.XX.XX
lerna notice filename: package-1-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice === Tarball Details ===
lerna notice name: package-1
lerna notice version: XX.XX.XX
lerna notice filename: package-1-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 2
lerna notice
lerna notice total files: 2
lerna notice
lerna verb publish package-2
lerna success published package-2 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-2@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice XXXkb package.json
lerna notice === Tarball Details ===
lerna notice name: package-2
lerna notice version: XX.XX.XX
lerna notice filename: package-2-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice === Tarball Details ===
lerna notice name: package-2
lerna notice version: XX.XX.XX
lerna notice filename: package-2-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 2
lerna notice
lerna notice total files: 2
lerna notice
lerna verb publish package-3
lerna success published package-3 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-3@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice === Tarball Contents ===
lerna notice 99B lib/package-3.js
lerna notice XXXB package.json
lerna notice 119B README.md
lerna notice === Tarball Details ===
lerna notice name: package-3
lerna notice version: XX.XX.XX
lerna notice filename: package-3-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice XXXB package.json
lerna notice 119B README.md
lerna notice === Tarball Details ===
lerna notice name: package-3
lerna notice version: XX.XX.XX
lerna notice filename: package-3-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 3
lerna notice
lerna notice total files: 3
lerna notice
Successfully published:
- package-1@XX.XX.XX
- package-2@XX.XX.XX
Expand Down Expand Up @@ -323,7 +325,7 @@ describe("lerna-publish-custom-publish-directories", () => {
- package-1 => XX.XX.XX
- package-2 => XX.XX.XX
lerna info auto-confirmed
lerna info auto-confirmed
lerna info publish Publishing packages to npm...
lerna notice Skipping all user and access validation due to third-party registry
lerna notice Make sure you're authenticated properly ¯\\_(ツ)_/¯
Expand All @@ -344,38 +346,38 @@ describe("lerna-publish-custom-publish-directories", () => {
lerna verb packed dist/packages/package-2
lerna verb publish package-1
lerna success published package-1 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice XXXkb package.json
lerna notice === Tarball Details ===
lerna notice name: package-1
lerna notice version: XX.XX.XX
lerna notice filename: package-1-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice === Tarball Details ===
lerna notice name: package-1
lerna notice version: XX.XX.XX
lerna notice filename: package-1-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 2
lerna notice
lerna notice total files: 2
lerna notice
lerna verb publish package-2
lerna success published package-2 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-2@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice XXXkb package.json
lerna notice === Tarball Details ===
lerna notice name: package-2
lerna notice version: XX.XX.XX
lerna notice filename: package-2-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice === Tarball Details ===
lerna notice name: package-2
lerna notice version: XX.XX.XX
lerna notice filename: package-2-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 2
lerna notice
lerna notice total files: 2
lerna notice
Successfully published:
- package-1@XX.XX.XX
- package-2@XX.XX.XX
Expand Down Expand Up @@ -482,7 +484,7 @@ describe("lerna-publish-custom-publish-directories", () => {
- package-1 => XX.XX.XX
- package-2 => XX.XX.XX
lerna info auto-confirmed
lerna info auto-confirmed
lerna info publish Publishing packages to npm...
lerna notice Skipping all user and access validation due to third-party registry
lerna notice Make sure you're authenticated properly ¯\\_(ツ)_/¯
Expand All @@ -500,39 +502,39 @@ describe("lerna-publish-custom-publish-directories", () => {
lerna verb packed packages/package-2
lerna verb publish package-1
lerna success published package-1 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-1@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice === Tarball Contents ===
lerna notice 99B lib/main.js
lerna notice XXXkb package.json
lerna notice === Tarball Details ===
lerna notice name: package-1
lerna notice version: XX.XX.XX
lerna notice filename: package-1-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice === Tarball Details ===
lerna notice name: package-1
lerna notice version: XX.XX.XX
lerna notice filename: package-1-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 2
lerna notice
lerna notice total files: 2
lerna notice
lerna verb publish package-2
lerna success published package-2 XX.XX.XX
lerna notice
lerna notice
lerna notice 📦 package-2@XX.XX.XX
lerna notice === Tarball Contents ===
lerna notice === Tarball Contents ===
lerna notice 99B lib/package-2.js
lerna notice XXXB package.json
lerna notice 119B README.md
lerna notice === Tarball Details ===
lerna notice name: package-2
lerna notice version: XX.XX.XX
lerna notice filename: package-2-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice XXXB package.json
lerna notice 119B README.md
lerna notice === Tarball Details ===
lerna notice name: package-2
lerna notice version: XX.XX.XX
lerna notice filename: package-2-XX.XX.XX.tgz
lerna notice package size: XXXB
lerna notice unpacked size: XXX.XXX kb
lerna notice shasum: {FULL_COMMIT_SHA}
lerna notice integrity: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
lerna notice total files: 3
lerna notice
lerna notice total files: 3
lerna notice
Successfully published:
- package-1@XX.XX.XX
- package-2@XX.XX.XX
Expand Down
Loading

0 comments on commit acd2760

Please sign in to comment.