diff --git a/.github/workflows/rstest-ecosystem-ci-from-commit.yml b/.github/workflows/rstest-ecosystem-ci-from-commit.yml index 3dd3f03..3379e88 100644 --- a/.github/workflows/rstest-ecosystem-ci-from-commit.yml +++ b/.github/workflows/rstest-ecosystem-ci-from-commit.yml @@ -29,6 +29,7 @@ on: - rslib - rsbuild - rsdoctor + - modernjs # - examples suiteRefType: description: "type of suite ref to use" @@ -76,8 +77,8 @@ jobs: strategy: matrix: include: - # - suite: modernjs - # os: ubuntu-latest + - suite: modernjs + os: ubuntu-latest # - suite: plugins # os: ubuntu-latest - suite: rspress diff --git a/.github/workflows/rstest-ecosystem-ci-from-pr.yml b/.github/workflows/rstest-ecosystem-ci-from-pr.yml index 41b80ae..fb566ee 100644 --- a/.github/workflows/rstest-ecosystem-ci-from-pr.yml +++ b/.github/workflows/rstest-ecosystem-ci-from-pr.yml @@ -33,6 +33,7 @@ on: - rspress - rsbuild - rsdoctor + - modernjs suiteRefType: description: "type of suite ref to use" required: true @@ -82,6 +83,8 @@ jobs: os: ubuntu-latest - suite: rsdoctor os: ubuntu-latest + - suite: modernjs + os: ubuntu-latest fail-fast: false runs-on: ${{ matrix.os }} name: execute-all (${{ matrix.suite }}) diff --git a/.github/workflows/rstest-ecosystem-ci-selected.yml b/.github/workflows/rstest-ecosystem-ci-selected.yml index 891291e..6393709 100644 --- a/.github/workflows/rstest-ecosystem-ci-selected.yml +++ b/.github/workflows/rstest-ecosystem-ci-selected.yml @@ -40,6 +40,7 @@ on: - rslib - rsbuild - rsdoctor + - modernjs # - examples suiteRefType: description: "type of suite ref to use" @@ -92,6 +93,8 @@ jobs: os: ubuntu-latest - suite: rsdoctor os: ubuntu-latest + - suite: modernjs + os: ubuntu-latest # - suite: examples # os: ubuntu-latest fail-fast: false diff --git a/package.json b/package.json index 7a69fb7..929c73c 100644 --- a/package.json +++ b/package.json @@ -36,7 +36,7 @@ "devDependencies": { "@antfu/ni": "^0.20.0", "@biomejs/biome": "^1.9.4", - "@types/node": "^18.15.5", + "@types/node": "^24.10.1", "@types/semver": "^7.3.13", "bumpp": "^10.3.2", "nano-staged": "^0.8.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index e093f6f..9bb1662 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -37,8 +37,8 @@ importers: specifier: ^1.9.4 version: 1.9.4 '@types/node': - specifier: ^18.15.5 - version: 18.19.74 + specifier: ^24.10.1 + version: 24.10.4 '@types/semver': specifier: ^7.3.13 version: 7.5.8 @@ -892,8 +892,8 @@ packages: '@tybys/wasm-util@0.10.1': resolution: {integrity: sha512-9tTaPJLSiejZKx+Bmog4uSubteqTvFrVrURwkmHixBo0G4seD0zUxp98E1DzUBJxLQ3NPwXrGKDiVjwx/DpPsg==} - '@types/node@18.19.74': - resolution: {integrity: sha512-HMwEkkifei3L605gFdV+/UwtpxP6JSzM+xFk2Ia6DNFSwSVBRh9qp5Tgf4lNFOMfPVuU0WnkcWpXZpgn5ufO4A==} + '@types/node@24.10.4': + resolution: {integrity: sha512-vnDVpYPMzs4wunl27jHrfmwojOGKya0xyM3sH+UE5iv5uPS6vX7UIoh6m+vQc5LGBq52HBKPIn/zcSZVzeDEZg==} '@types/prop-types@15.7.15': resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} @@ -2663,8 +2663,8 @@ packages: engines: {node: '>=0.8.0'} hasBin: true - undici-types@5.26.5: - resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + undici-types@7.16.0: + resolution: {integrity: sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==} undici@5.28.5: resolution: {integrity: sha512-zICwjrDrcrUE0pyyJc1I2QzBkLM8FINsgOrt6WjA+BgajVq9Nxu2PbFFXUrAggLfDXlZGZBVZYw7WNV5KiBiBA==} @@ -3552,9 +3552,9 @@ snapshots: tslib: 2.8.1 optional: true - '@types/node@18.19.74': + '@types/node@24.10.4': dependencies: - undici-types: 5.26.5 + undici-types: 7.16.0 '@types/prop-types@15.7.15': {} @@ -3569,7 +3569,7 @@ snapshots: '@types/responselike@1.0.0': dependencies: - '@types/node': 18.19.74 + '@types/node': 24.10.4 '@types/semver@7.5.8': {} @@ -5393,7 +5393,7 @@ snapshots: uglify-js@3.19.3: optional: true - undici-types@5.26.5: {} + undici-types@7.16.0: {} undici@5.28.5: dependencies: diff --git a/tests/rstest/modernjs.ts b/tests/rstest/modernjs.ts new file mode 100644 index 0000000..ba161a0 --- /dev/null +++ b/tests/rstest/modernjs.ts @@ -0,0 +1,47 @@ +import { join } from 'node:path'; +import cache from '@actions/cache'; +import type { RunOptions } from '../../types'; +import { $, runInRepo } from '../../utils'; + +const isGitHubActions = !!process.env.GITHUB_ACTIONS; + +export async function test(options: RunOptions) { + let nxCachePath: string; + let nxCacheKey: string; + + await runInRepo({ + ...options, + repo: 'web-infra-dev/modern.js', + branch: process.env.MODERNJS ?? 'main', + beforeInstall: async () => { + if (isGitHubActions) { + const modernJsDir = join(process.cwd(), 'workspace/modernjs/modern.js'); + nxCachePath = join(modernJsDir, '.nx/cache'); + const sha = await $`git rev-parse HEAD`; + nxCacheKey = `modernjs-nx-${sha.trim()}`; + const restoreKeys = ['modernjs-nx-']; + const cacheHitKey = await cache.restoreCache( + [nxCachePath], + nxCacheKey, + restoreKeys, + ); + if (cacheHitKey) { + console.log(`Cache hit for key: ${cacheHitKey}`); + await $`ls -lah .nx/cache`; + } else { + console.log( + `Cache miss for key: ${nxCacheKey}, proceeding without cache.`, + ); + } + } + }, + afterInstall: async () => { + if (isGitHubActions) { + console.log('Caching `.nx/cache` directory for future builds.'); + await $`ls -lah .nx/cache`; + await cache.saveCache([nxCachePath], nxCacheKey); + } + }, + test: ['test:rstest'], + }); +} diff --git a/tsconfig.json b/tsconfig.json index a8c5943..46d64b4 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,8 +3,8 @@ "exclude": ["**/node_modules/**"], "compilerOptions": { "target": "esnext", - "module": "nodenext", - "moduleResolution": "node", + "module": "esnext", + "moduleResolution": "bundler", "strict": true, "declaration": true, "noImplicitOverride": true,