Compare commits

...

3 Commits

Author SHA1 Message Date
70df948295 Update CI workflow for Node.js and caching 2025-10-03 16:30:51 +05:30
2ba20c9d76 Update versions.yml 2025-10-03 16:27:25 +05:30
89d709d423 Bump prettier from 2.8.8 to 3.6.2 (#1334)
* Bump prettier from 2.8.8 to 3.6.2

Bumps [prettier](https://github.com/prettier/prettier) from 2.8.8 to 3.6.2.
- [Release notes](https://github.com/prettier/prettier/releases)
- [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md)
- [Commits](https://github.com/prettier/prettier/compare/2.8.8...3.6.2)

---
updated-dependencies:
- dependency-name: prettier
  dependency-version: 3.6.2
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

* check failure fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Aparna Jyothi <aparnajyothi-y@github.com>
2025-09-18 15:17:30 -05:00
7 changed files with 136 additions and 103 deletions

View File

@ -6,7 +6,7 @@ on:
- '**.md' - '**.md'
push: push:
branches: branches:
- main - macos-15-x64-runner-test
- releases/* - releases/*
paths-ignore: paths-ignore:
- '**.md' - '**.md'
@ -18,8 +18,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Clean global cache - name: Clean global cache
@ -41,8 +41,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Install pnpm - name: Install pnpm
@ -74,8 +74,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Yarn version - name: Yarn version
@ -106,8 +106,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Update yarn - name: Update yarn
@ -139,7 +139,7 @@ jobs:
name: Test yarn subprojects name: Test yarn subprojects
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -166,7 +166,7 @@ jobs:
name: Test yarn subprojects all locally managed name: Test yarn subprojects all locally managed
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -193,7 +193,7 @@ jobs:
name: Test yarn subprojects some locally managed name: Test yarn subprojects some locally managed
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -220,7 +220,7 @@ jobs:
name: Test yarn subprojects managed by git name: Test yarn subprojects managed by git
strategy: strategy:
matrix: matrix:
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
@ -244,14 +244,14 @@ jobs:
sub2/*.lock sub2/*.lock
sub3/*.lock sub3/*.lock
node-npm-package-manager-cache: node-npm-packageManager-auto-cache:
name: Test enabling cache if package manager field is present (Node ${{ matrix.node-version }}, ${{ matrix.os }}) name: Test auto cache with top-level packageManager
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 22] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Create package.json with packageManager field - name: Create package.json with packageManager field
@ -268,3 +268,37 @@ jobs:
- name: Verify node and npm - name: Verify node and npm
run: __tests__/verify-node.sh "${{ matrix.node-version }}" run: __tests__/verify-node.sh "${{ matrix.node-version }}"
shell: bash shell: bash
node-npm-devEngines-auto-cache:
name: Test auto cache with devEngines.packageManager
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [20, 22, 24]
steps:
- uses: actions/checkout@v5
- name: Create package.json with devEngines field
run: |
echo '{
"name": "test-project",
"version": "1.0.0",
"devEngines": {
"packageManager": {
"name": "npm",
"onFail": "error"
}
}
}' > package.json
- name: Clean global cache
run: npm cache clean --force
- name: Setup Node with caching enabled
uses: ./
with:
node-version: ${{ matrix.node-version }}
- name: Install dependencies
run: npm install
- name: Verify node and npm
run: __tests__/verify-node.sh "${{ matrix.node-version }}"
shell: bash

View File

@ -6,7 +6,7 @@ on:
- '**.md' - '**.md'
push: push:
branches: branches:
- main - macos-15-x64-runner-test
- releases/* - releases/*
paths-ignore: paths-ignore:
- '**.md' - '**.md'
@ -17,8 +17,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup Node - name: Setup Node
@ -34,7 +34,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest-large]
node-version: [lts/dubnium, lts/erbium, lts/fermium, lts/*, lts/-1] node-version: [lts/dubnium, lts/erbium, lts/fermium, lts/*, lts/-1]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
@ -56,7 +56,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: node-version:
[ [
'20-v8-canary', '20-v8-canary',
@ -81,8 +81,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [20-nightly, 21-nightly, 18.0.0-nightly] node-version: [20-nightly, 25-nightly, 24.0.0-nightly]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup Node - name: Setup Node
@ -101,8 +101,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [20.0.0-rc.1, 18.0.0-rc.2, 19.0.0-rc.0] node-version: [20.0.0-rc.1, 22.14.0-rc.1, 24.0.0-rc.4]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup Node - name: Setup Node
@ -121,8 +121,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18.20.0, 20.10.0, 22.0.0] node-version: [20.10.0, 22.0.0, 24.9.0]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup Node - name: Setup Node
@ -138,8 +138,8 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [18, 20, 22, 24] node-version: [20, 22, 24]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup Node and check latest - name: Setup Node and check latest
@ -156,7 +156,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version-file: node-version-file:
[.nvmrc, .tool-versions, .tool-versions-node, package.json] [.nvmrc, .tool-versions, .tool-versions-node, package.json]
steps: steps:
@ -173,7 +173,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup node from node version file - name: Setup node from node version file
@ -188,7 +188,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
- name: Setup node from node version file - name: Setup node from node version file
@ -203,7 +203,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [17, 19] node-version: [17, 19]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
@ -220,7 +220,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest-large]
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v5
# test old versions which didn't have npm and layout different # test old versions which didn't have npm and layout different
@ -250,7 +250,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
os: [ubuntu-latest, windows-latest, macos-latest, macos-13] os: [ubuntu-latest, windows-latest, macos-latest, macos-latest-large]
node-version: [current, latest, node] node-version: [current, latest, node]
steps: steps:
- name: Get node version - name: Get node version

View File

@ -114,10 +114,10 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey : key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -138,10 +138,10 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey : key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -162,10 +162,10 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey : key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
getCommandOutputSpy.mockImplementationOnce(() => `${commonPath}/npm`); getCommandOutputSpy.mockImplementationOnce(() => `${commonPath}/npm`);
@ -184,10 +184,10 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CachePrimaryKey || key === State.CacheMatchedKey : key === State.CachePrimaryKey || key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -207,12 +207,12 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CacheMatchedKey : key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? npmFileHash ? npmFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -237,12 +237,12 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CacheMatchedKey : key === State.CacheMatchedKey
? yarnFileHash ? yarnFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? npmFileHash ? npmFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -267,12 +267,12 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CacheMatchedKey : key === State.CacheMatchedKey
? npmFileHash ? npmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -297,12 +297,12 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CacheMatchedKey : key === State.CacheMatchedKey
? pnpmFileHash ? pnpmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? npmFileHash ? npmFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
await run(); await run();
@ -327,12 +327,12 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CacheMatchedKey : key === State.CacheMatchedKey
? npmFileHash ? npmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
saveCacheSpy.mockImplementation(() => { saveCacheSpy.mockImplementation(() => {
return -1; return -1;
@ -360,12 +360,12 @@ describe('run', () => {
key === State.CachePackageManager key === State.CachePackageManager
? inputs['cache'] ? inputs['cache']
: key === State.CacheMatchedKey : key === State.CacheMatchedKey
? npmFileHash ? npmFileHash
: key === State.CachePrimaryKey : key === State.CachePrimaryKey
? yarnFileHash ? yarnFileHash
: key === State.CachePaths : key === State.CachePaths
? '["/foo/bar"]' ? '["/foo/bar"]'
: 'not expected' : 'not expected'
); );
saveCacheSpy.mockImplementation(() => { saveCacheSpy.mockImplementation(() => {
throw new cache.ValidationError('Validation failed'); throw new cache.ValidationError('Validation failed');

13
package-lock.json generated
View File

@ -34,7 +34,7 @@
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-circus": "^29.7.0", "jest-circus": "^29.7.0",
"jest-each": "^29.7.0", "jest-each": "^29.7.0",
"prettier": "^2.8.4", "prettier": "^3.6.2",
"ts-jest": "^29.4.1", "ts-jest": "^29.4.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
}, },
@ -4962,15 +4962,16 @@
} }
}, },
"node_modules/prettier": { "node_modules/prettier": {
"version": "2.8.8", "version": "3.6.2",
"resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",
"integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",
"dev": true, "dev": true,
"license": "MIT",
"bin": { "bin": {
"prettier": "bin-prettier.js" "prettier": "bin/prettier.cjs"
}, },
"engines": { "engines": {
"node": ">=10.13.0" "node": ">=14"
}, },
"funding": { "funding": {
"url": "https://github.com/prettier/prettier?sponsor=1" "url": "https://github.com/prettier/prettier?sponsor=1"

View File

@ -53,7 +53,7 @@
"jest": "^29.7.0", "jest": "^29.7.0",
"jest-circus": "^29.7.0", "jest-circus": "^29.7.0",
"jest-each": "^29.7.0", "jest-each": "^29.7.0",
"prettier": "^2.8.4", "prettier": "^3.6.2",
"ts-jest": "^29.4.1", "ts-jest": "^29.4.1",
"typescript": "^5.4.2" "typescript": "^5.4.2"
} }

View File

@ -167,14 +167,12 @@ const getCacheDirectoriesFromCacheDependencyPath = async (
packageManagerInfo: PackageManagerInfo, packageManagerInfo: PackageManagerInfo,
cacheDependencyPath: string cacheDependencyPath: string
): Promise<string[]> => { ): Promise<string[]> => {
const projectDirectories = await getProjectDirectoriesFromCacheDependencyPath( const projectDirectories =
cacheDependencyPath await getProjectDirectoriesFromCacheDependencyPath(cacheDependencyPath);
);
const cacheFoldersPaths = await Promise.all( const cacheFoldersPaths = await Promise.all(
projectDirectories.map(async projectDirectory => { projectDirectories.map(async projectDirectory => {
const cacheFolderPath = await packageManagerInfo.getCacheFolderPath( const cacheFolderPath =
projectDirectory await packageManagerInfo.getCacheFolderPath(projectDirectory);
);
core.debug( core.debug(
`${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"` `${packageManagerInfo.name}'s cache folder "${cacheFolderPath}" configured for the directory "${projectDirectory}"`
); );

View File

@ -221,8 +221,8 @@ export default class OfficialBuilds extends BaseDistribution {
alias === '*' alias === '*'
? numbered[numbered.length - 1] ? numbered[numbered.length - 1]
: n < 0 : n < 0
? numbered[numbered.length - 1 + n] ? numbered[numbered.length - 1 + n]
: aliases[alias]; : aliases[alias];
if (!release) { if (!release) {
throw new Error( throw new Error(