我已经在.circleci /目录中的react-native项目中添加了一个config.yml文件,以便配置构建管道。
但是在我的CircleCI 2.0服务器中只有第一个作业,build
在test
和android
运行时运行,尽管它们是整个工作流配置的一部分。
我已按照https://circleci.com/docs/2.0/workflows/中的工作流程配置指南配置顺序工作流程。
我确认我的CI服务器正在使用下面的配置
问题:
如何在CircleCI 2.0上配置顺序工作流程?
回购中的config.yml文件:
# Javascript Node CircleCI 2.0 configuration file
#
# Check https://circleci.com/docs/2.0/language-javascript/ for more details
#
version: 2
machine:
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
dependencies:
override:
- yarn
- jest
cache_directories:
- ~/.cache/yarn
- ~/.cache/jest
build:
override:
- yarn install
jobs:
build:
working_directory: ~/repo
docker:
- image: circleci/node:8
steps:
- checkout
- run: yarn install
- persist_to_workspace:
root: ~/repo
paths:
- node_modules
test:
working_directory: ~/repo
docker:
- image: circleci/node:8.9.0
steps:
- checkout
- run: yarn install
- run: npm test
- persist_to_workspace:
root: ~/repo
paths:
- node_modules
android:
working_directory: ~/repo/android
docker:
- image: circleci/android:api-27-node8-alpha
steps:
- checkout:
path: ~/repo
- attach_workspace:
at: ~/repo
- run: bundle install
#- run: bundle exec fastlane test
- store_test_results:
path: ~/root/android/reports
workflows:
version: 2
node-android:
jobs:
- build:
filters:
tags:
ignore: /^testing
- test
requires:
- test
- android:
requires:
- test
- build
答案 0 :(得分:0)
我通过将CI 1.0语法删除为@FelicianoTech mentioend来修复工作流程,这段YAML不是2.0 CircleCI语法:
machine:
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
dependencies:
override:
- yarn
- jest
cache_directories:
- ~/.cache/yarn
- ~/.cache/jest
build:
override:
- yarn install