diff --git a/.workflow/BranchPipeline.yml b/.workflow/BranchPipeline.yml deleted file mode 100644 index cbe1b451e637b8fd0f1df068edc0357ae06f46c6..0000000000000000000000000000000000000000 --- a/.workflow/BranchPipeline.yml +++ /dev/null @@ -1,55 +0,0 @@ -version: '1.0' -name: branch-pipeline -displayName: BranchPipeline -stages: - - stage: - name: compile - displayName: 编译 - steps: - - step: build@nodejs - name: build_nodejs - displayName: Nodejs 构建 - # 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本 - nodeVersion: 14.16.0 - # 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】 - commands: - - cd vue-demo && npm install && rm -rf ./dist && npm run build - # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 - artifacts: - # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 - - name: BUILD_ARTIFACT - # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径 - path: - - ./vue-demo/dist - - step: publish@general_artifacts - name: publish_general_artifacts - displayName: 上传制品 - # 上游构建任务定义的产物名,默认BUILD_ARTIFACT - dependArtifact: BUILD_ARTIFACT - # 构建产物制品库,默认default,系统默认创建 - artifactRepository: default - # 上传到制品库时的制品命名,默认build - artifactName: output - dependsOn: build_nodejs - - stage: - name: release - displayName: 发布 - steps: - - step: publish@release_artifacts - name: publish_release_artifacts - displayName: '发布' - # 上游上传制品任务的产出 - dependArtifact: output - # 发行版制品库,默认release,系统默认创建 - artifactRepository: release - # 发布制品版本号 - version: '1.0.0.0' - # 是否开启版本号自增,默认开启 - autoIncrement: true -triggers: - push: - branches: - exclude: - - master - include: - - .* diff --git a/.workflow/PRPipeline.yml b/.workflow/PRPipeline.yml deleted file mode 100644 index c5cce540e072eede6a405f55acb9056e6debcd2a..0000000000000000000000000000000000000000 --- a/.workflow/PRPipeline.yml +++ /dev/null @@ -1,38 +0,0 @@ -version: '1.0' -name: pr-pipeline -displayName: PRPipeline -stages: - - stage: - name: compile - displayName: 编译 - steps: - - step: build@nodejs - name: build_nodejs - displayName: Nodejs 构建 - # 支持8.16.2、10.17.0、12.16.1、14.16.0、15.12.0五个版本 - nodeVersion: 14.16.0 - # 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】 - commands: - - cd vue-demo && npm install && rm -rf ./dist && npm run build - # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 - artifacts: - # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 - - name: BUILD_ARTIFACT - # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径 - path: - - ./vue-demo/dist - - step: publish@general_artifacts - name: publish_general_artifacts - displayName: 上传制品 - # 上游构建任务定义的产物名,默认BUILD_ARTIFACT - dependArtifact: BUILD_ARTIFACT - # 构建产物制品库,默认default,系统默认创建 - artifactRepository: default - # 上传到制品库时的制品命名,默认build - artifactName: output - dependsOn: build_nodejs -triggers: - pr: - branches: - include: - - master diff --git a/.workflow/branch-pipeline.yml b/.workflow/branch-pipeline.yml new file mode 100644 index 0000000000000000000000000000000000000000..e5c999d7ba0c784faed4898aa028b09a9a3541cd --- /dev/null +++ b/.workflow/branch-pipeline.yml @@ -0,0 +1,37 @@ +version: '1.0' +name: branch-pipeline +displayName: BranchPipeline +triggers: + trigger: auto + push: + branches: + include: + - .* + exclude: + - master +stages: + - name: compile + displayName: 编译 + strategy: naturally + trigger: auto + steps: + - step: ut@nodejs + name: unit_test_nodejs + displayName: Nodejs 单元测试 + nodeVersion: 20.10.0 + commands: + - '# 设置NPM源,提升安装速度' + - npm config set registry https://registry.npmmirror.com + - '# 在这里输入测试命令' + - npm install && npm run test + report: + path: mochawesome-report + file: mochawesome.html + index: mochawesome.html + checkpoints: [] + caches: + - ~/.npm + - ~/.yarn + notify: [] + strategy: + retry: '0' diff --git a/.workflow/MasterPipeline.yml b/.workflow/master-pipeline.yml similarity index 82% rename from .workflow/MasterPipeline.yml rename to .workflow/master-pipeline.yml index 70a18451a0fb18a914f9335459f1d0e47be73e06..8faf2bcc2657acf6c4d4b1da07d4a581916b37c9 100644 --- a/.workflow/MasterPipeline.yml +++ b/.workflow/master-pipeline.yml @@ -13,22 +13,20 @@ stages: nodeVersion: 14.16.0 # 构建命令:安装依赖 -> 清除上次打包产物残留 -> 执行构建 【请根据项目实际产出进行填写】 commands: - - cd vue-demo && npm install && rm -rf ./dist && npm run build + - npm install && rm -rf ./dist && npm run build # 非必填字段,开启后表示将构建产物暂存,但不会上传到制品库中,7天后自动清除 artifacts: # 构建产物名字,作为产物的唯一标识可向下传递,支持自定义,默认为BUILD_ARTIFACT。在下游可以通过${BUILD_ARTIFACT}方式引用来获取构建物地址 - name: BUILD_ARTIFACT # 构建产物获取路径,是指代码编译完毕之后构建物的所在路径 path: - - ./vue-demo/dist + - ./dist - step: publish@general_artifacts name: publish_general_artifacts displayName: 上传制品 # 上游构建任务定义的产物名,默认BUILD_ARTIFACT dependArtifact: BUILD_ARTIFACT - # 构建产物制品库,默认default,系统默认创建 - artifactRepository: default - # 上传到制品库时的制品命名,默认build + # 上传到制品库时的制品命名,默认output artifactName: output dependsOn: build_nodejs - stage: @@ -40,8 +38,6 @@ stages: displayName: '发布' # 上游上传制品任务的产出 dependArtifact: output - # 发行版制品库,默认release,系统默认创建 - artifactRepository: release # 发布制品版本号 version: '1.0.0.0' # 是否开启版本号自增,默认开启 diff --git a/.workflow/pipeline-20230413.yml b/.workflow/pipeline-20230413.yml new file mode 100644 index 0000000000000000000000000000000000000000..d3d2c608a61b1d228b1e130320c2b4c10fc9aade --- /dev/null +++ b/.workflow/pipeline-20230413.yml @@ -0,0 +1,36 @@ +version: '1.0' +name: pipeline-20230413 +displayName: pipeline-20230413 +triggers: + trigger: auto + push: + branches: + prefix: + - '' +stages: + - name: stage-dfb5662b + displayName: 未命名 + strategy: naturally + trigger: auto + executor: [] + steps: + - step: build@nodejs + name: build_nodejs + displayName: Nodejs 构建 + nodeVersion: 14.16.0 + commands: + - '# 设置NPM源,提升安装速度' + - npm config set registry https://registry.npmmirror.com + - '' + - '# 执行编译命令' + - npm install && npm run build + artifacts: + - name: BUILD_ARTIFACT + path: + - ./dist + caches: + - ~/.npm + - ~/.yarn + notify: [] + strategy: + retry: '0' diff --git a/.workflow/pr-pipeline.yml b/.workflow/pr-pipeline.yml new file mode 100644 index 0000000000000000000000000000000000000000..4fc9188774bbeb383aca647c605f6e7709cd614b --- /dev/null +++ b/.workflow/pr-pipeline.yml @@ -0,0 +1,70 @@ +version: '1.0' +name: pr-pipeline +displayName: PRPipeline +triggers: + trigger: auto + pr: + branches: + include: + - master +stages: + - name: test + displayName: test + strategy: naturally + trigger: auto + steps: + - step: ut@nodejs + name: unit_test_nodejs + displayName: Nodejs 单元测试 + nodeVersion: 20.10.0 + commands: + - '# 设置NPM源,提升安装速度' + - npm config set registry https://registry.npmmirror.com + - '# 在这里输入测试命令' + - npm install && npm run test + report: + path: mochawesome-report + file: mochawesome.json + index: mochawesome.html + checkpoints: [] + caches: + - ~/.npm + - ~/.yarn + notify: [] + strategy: + retry: '0' + - name: upload + displayName: upload + strategy: naturally + trigger: auto + executor: [] + steps: + - step: build@nodejs + name: build_nodejs + displayName: Nodejs 构建 + nodeVersion: 20.10.0 + commands: + - '# 设置NPM源,提升安装速度' + - npm config set registry https://registry.npmmirror.com + - '' + - '# 执行编译命令' + - npm install && npm run test + artifacts: + - name: BUILD_ARTIFACT + path: + - ./mochawesome-report + caches: + - ~/.npm + - ~/.yarn + notify: [] + strategy: + retry: '0' + - step: publish@general_artifacts + name: publish_general_artifacts + displayName: 上传制品 + dependArtifact: BUILD_ARTIFACT + artifactName: output + notify: [] + strategy: + retry: '0' + dependsOn: build_nodejs diff --git a/README.md b/README.md index 2c98313d360babc2ef01e3242717e3a39051ff30..c4085921ff755bf903e8769b00cf671281731a1b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React, webpack -Full documentation about it [here](https://mochajs.org/#-require-module-r-module) +Full documentation about it [here](fhttps://mochajs.org/#-require-module-r-module) ## Commands diff --git a/junit.xml b/junit.xml new file mode 100644 index 0000000000000000000000000000000000000000..a7f8d3b162424dc5006577a791b66c878d368b87 --- /dev/null +++ b/junit.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/package.json b/package.json index af28bc97faf2162c88f03fc0c6e1c7b0a2a1cafe..134c84e7e77b1629fd6d18780bb1076be4dc1bab 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "scripts": { "build": "webpack", "start": "npm run build && opn index.html", - "test": "mocha --require @babel/register --reporter mochawesome --exit" + "test": "mocha --require @babel/register --reporter mochawesome --exit" }, "directories": { "lib": "./lib", @@ -16,6 +16,7 @@ }, "dependencies": { "express": "^4.18.1", + "mocha-junit-reporter": "^2.2.1", "opn-cli": "^5.0.0", "react": "^17.0.2", "react-dom": "^17.0.2"