mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 19:21:34 +08:00
chore(ci): split out tests
This commit is contained in:
@ -1,33 +1,96 @@
|
|||||||
version: 2
|
version: 2
|
||||||
|
|
||||||
jobs:
|
aliases:
|
||||||
build:
|
- &restore-cache
|
||||||
working_directory: /tmp/workspace
|
keys:
|
||||||
docker:
|
- dependency-cache-{{ checksum "package.json" }}
|
||||||
- image: circleci/node:latest-browsers
|
|
||||||
branches:
|
- &save-cache
|
||||||
# ignore:
|
|
||||||
# - core
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
- restore_cache:
|
|
||||||
key: dependency-cache-{{ checksum "package.json" }}
|
|
||||||
- run:
|
|
||||||
name: Install monorepo node modules
|
|
||||||
command: npm i
|
|
||||||
- save_cache:
|
|
||||||
key: dependency-cache-{{ checksum "package.json" }}
|
key: dependency-cache-{{ checksum "package.json" }}
|
||||||
paths:
|
paths:
|
||||||
- node_modules
|
- node_modules
|
||||||
- restore_cache:
|
|
||||||
key: dependency-cache-{{ checksum "core/package.json" }}
|
- &restore-cache-core
|
||||||
- run:
|
keys:
|
||||||
name: Install core node modules
|
- dependency-cache-{{ checksum "core/package.json" }}
|
||||||
command: npm --prefix core/ i
|
|
||||||
- save_cache:
|
- &save-cache-core
|
||||||
key: dependency-cache-{{ checksum "core/package.json" }}
|
key: dependency-cache-{{ checksum "core/package.json" }}
|
||||||
paths:
|
paths:
|
||||||
- core/node_modules
|
- core/node_modules
|
||||||
- run:
|
|
||||||
name: Validate Core
|
|
||||||
command: npm --prefix core/ run validate.ci
|
defaults: &defaults
|
||||||
|
docker:
|
||||||
|
- image: circleci/node:latest-browsers
|
||||||
|
working_directory: /tmp/workspace
|
||||||
|
|
||||||
|
defaults-core: &defaults-core
|
||||||
|
<<: *defaults-core
|
||||||
|
working_directory: /tmp/workspace/core
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
<<: *defaults
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- restore_cache: *restore-cache
|
||||||
|
- run: npm install
|
||||||
|
- save_cache: *save-cache
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: /tmp/workspace
|
||||||
|
paths:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
build-core:
|
||||||
|
<<: *defaults-core
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- restore_cache: *restore-cache-core
|
||||||
|
- run: npm install
|
||||||
|
- save_cache: *save-cache-core
|
||||||
|
- run: npm run build --max-workers 1 --debug
|
||||||
|
- persist_to_workspace:
|
||||||
|
root: /tmp/workspace
|
||||||
|
paths:
|
||||||
|
- "*"
|
||||||
|
|
||||||
|
test-core-lint:
|
||||||
|
<<: *defaults-core
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- run: npm run lint
|
||||||
|
|
||||||
|
test-core-spec:
|
||||||
|
<<: *defaults-core
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- run: npm run test.spec
|
||||||
|
|
||||||
|
test-core-treeshake:
|
||||||
|
<<: *defaults-core
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- attach_workspace:
|
||||||
|
at: /tmp/workspace
|
||||||
|
- run: npm run test.treeshake
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build:
|
||||||
|
jobs:
|
||||||
|
- build
|
||||||
|
- build-core:
|
||||||
|
requires: [build]
|
||||||
|
- test-core-lint:
|
||||||
|
requires: [build-core]
|
||||||
|
- test-core-spec:
|
||||||
|
requires: [build-core]
|
||||||
|
- test-core-treeshake:
|
||||||
|
requires: [build-core]
|
||||||
|
@ -88,8 +88,7 @@
|
|||||||
"theme-server": "node scripts/theme-builder/server.js",
|
"theme-server": "node scripts/theme-builder/server.js",
|
||||||
"tsc": "./node_modules/.bin/tsc -p .",
|
"tsc": "./node_modules/.bin/tsc -p .",
|
||||||
"test.treeshake": "agadoo dist/collection/index.js",
|
"test.treeshake": "agadoo dist/collection/index.js",
|
||||||
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake",
|
"validate": "npm run lint && npm run test && npm run build && npm run test.treeshake"
|
||||||
"validate.ci": "npm run lint && npm run test.spec && npm run build --max-workers 1 --debug && npm run test.treeshake"
|
|
||||||
},
|
},
|
||||||
"author": "Ionic Team",
|
"author": "Ionic Team",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
Reference in New Issue
Block a user