Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/rstest-ecosystem-ci-from-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ on:
- rslib
- rsbuild
- rsdoctor
- modernjs
# - examples
suiteRefType:
description: "type of suite ref to use"
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rstest-ecosystem-ci-from-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ on:
- rspress
- rsbuild
- rsdoctor
- modernjs
suiteRefType:
description: "type of suite ref to use"
required: true
Expand Down Expand Up @@ -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 }})
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/rstest-ecosystem-ci-selected.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ on:
- rslib
- rsbuild
- rsdoctor
- modernjs
# - examples
suiteRefType:
description: "type of suite ref to use"
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
20 changes: 10 additions & 10 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 47 additions & 0 deletions tests/rstest/modernjs.ts
Original file line number Diff line number Diff line change
@@ -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'],
});
}
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"exclude": ["**/node_modules/**"],
"compilerOptions": {
"target": "esnext",
"module": "nodenext",
"moduleResolution": "node",
"module": "esnext",
"moduleResolution": "bundler",
"strict": true,
"declaration": true,
"noImplicitOverride": true,
Expand Down
Loading