-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
926 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Run e2e Tests for nx-melos | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
paths: [ "nx.json", "package.json", "workspace.json", "packages/common/**", "packages/nx-melos/**" ] | ||
pull_request: | ||
branches: [ develop ] | ||
paths: [ "nx.json", "package.json", "workspace.json", "packages/common/**", "packages/nx-melos/**" ] | ||
|
||
jobs: | ||
run_e2e: | ||
name: Run e2e Tests | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
node-version: [16.x] | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Use Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'temurin' | ||
java-version: 17 | ||
|
||
- name: Use Flutter | ||
uses: subosito/flutter-action@v2 | ||
with: | ||
channel: 'stable' | ||
cache: true | ||
cache-key: 'flutter-:os:-:channel:-:version:-:arch:-:hash:' # optional, change this to force refresh cache | ||
cache-path: '${{ runner.tool_cache }}/flutter/:channel:-:version:-:arch:' # optional, change this to specify the cache path | ||
architecture: x64 # optional, x64 or arm64 | ||
|
||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
|
||
- name: Yarn cache directory path | ||
id: yarn-cache-dir-path | ||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Cache Yarn | ||
uses: actions/cache@v3 | ||
env: | ||
cache-name: yarn | ||
with: | ||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }} | ||
key: ${{ matrix.os }}-node-${{ matrix.node-version }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} | ||
restore-keys: | | ||
${{ matrix.os }}-node-${{ matrix.node-version }}-${{ env.cache-name }}- | ||
- name: Install packages | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run e2e tests | ||
env: | ||
NX_E2E_CI_CACHE_KEY: e2e-gha-${{ matrix.os }}-${{ matrix.node-version }} | ||
NX_RUN_GROUP: ${{ github.run_id }}-${{ matrix.os }}-${{ matrix.node-version }} | ||
run: | | ||
yarn ts-node -P ./tools/tsconfig.tools.json ./tools/patch-nx-project.ts | ||
yarn nx e2e nx-melos-e2e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
/dist | ||
/tmp | ||
/out-tsc | ||
/bin | ||
|
||
# dependencies | ||
/node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn nx affected:test --parallel=5 --exclude=smoke | ||
yarn nx affected:test --parallel=6 --exclude=smoke |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/* eslint-disable */ | ||
export default { | ||
displayName: 'nx-melos-e2e', | ||
preset: '../../jest.preset.js', | ||
globals: { | ||
'ts-jest': { | ||
tsconfig: '<rootDir>/tsconfig.spec.json', | ||
}, | ||
}, | ||
transform: { | ||
'^.+\\.[tj]s$': 'ts-jest', | ||
}, | ||
moduleFileExtensions: ['ts', 'js', 'html'], | ||
coverageDirectory: '../../coverage/e2e/nx-melos-e2e', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"name": "nx-melos-e2e", | ||
"$schema": "../../node_modules/nx/schemas/project-schema.json", | ||
"projectType": "application", | ||
"sourceRoot": "e2e/nx-melos-e2e/src", | ||
"targets": { | ||
"e2e": { | ||
"executor": "@nrwl/nx-plugin:e2e", | ||
"options": { | ||
"target": "nx-melos:build", | ||
"jestConfig": "e2e/nx-melos-e2e/jest.config.ts" | ||
} | ||
} | ||
}, | ||
"tags": [], | ||
"implicitDependencies": ["nx-melos"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import { | ||
checkFilesExist, | ||
runNxCommandAsync, | ||
} from '@nrwl/nx-plugin/testing'; | ||
import { ensureNxProjectWithDeps } from '@nxrocks/common/testing'; | ||
|
||
describe('nx-melos e2e', () => { | ||
|
||
beforeAll(async () => { | ||
|
||
ensureNxProjectWithDeps('@nxrocks/nx-melos', 'dist/packages/nx-melos', | ||
[{ name: '@nxrocks/common', path: 'dist/packages/common' }]); | ||
}, 600000); | ||
|
||
afterAll(() => { | ||
// `nx reset` kills the daemon, and performs | ||
// some work which can help clean up e2e leftovers | ||
runNxCommandAsync('reset'); | ||
}); | ||
|
||
beforeEach(() => { | ||
}); | ||
|
||
afterEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
|
||
it('should initialize melos in the workspace', async() => { | ||
|
||
await runNxCommandAsync(`generate @nxrocks/nx-melos:init --scriptNameSeparator="-"`); | ||
|
||
const scripts = [ | ||
{ name: 'melos-bootstrap', output: `NX Successfully ran target melos-bootstrap for project proj` }, | ||
|
||
]; | ||
|
||
let totalExecutorsTime = 0; | ||
for (const script of scripts) { | ||
const start = new Date().getTime(); | ||
const result = await runNxCommandAsync(script.name); | ||
const end = new Date().getTime(); | ||
console.log(`${script.name} took ${end - start}ms`); | ||
totalExecutorsTime += end - start; | ||
expect(result.stdout).toContain(script.output); | ||
} | ||
console.log(`Total executors time: ${totalExecutorsTime}ms`); | ||
|
||
expect(() => | ||
checkFilesExist(`melos.yaml`) | ||
).not.toThrow(); | ||
}, 400000); | ||
|
||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": "../../tsconfig.base.json", | ||
"files": [], | ||
"include": [], | ||
"references": [ | ||
{ | ||
"path": "./tsconfig.spec.json" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"extends": "./tsconfig.json", | ||
"compilerOptions": { | ||
"outDir": "../../dist/out-tsc", | ||
"module": "commonjs", | ||
"types": ["jest", "node"] | ||
}, | ||
"include": ["jest.config.ts", "**/*.test.ts", "**/*.spec.ts", "**/*.d.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"extends": ["../../.eslintrc.json"], | ||
"ignorePatterns": ["!**/*"], | ||
"overrides": [ | ||
{ | ||
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.ts", "*.tsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["*.js", "*.jsx"], | ||
"rules": {} | ||
}, | ||
{ | ||
"files": ["./package.json", "./generators.json", "./executors.json"], | ||
"parser": "jsonc-eslint-parser", | ||
"rules": { | ||
"@nrwl/nx/nx-plugin-checks": "error" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const { createScopedReleaseConfig } = require('../../tools/release'); | ||
|
||
module.exports = createScopedReleaseConfig({ | ||
projectScope: 'nx-melos', | ||
projectRoot: 'packages/nx-melos', | ||
buildOutput: 'dist/packages/nx-melos', | ||
}); |
Oops, something went wrong.