Can’t figure out what I’m doing wrong…
version: 2
jobs:
install_deps:
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run:
name: Install Yarn then pkgs
command: npm i -g yarn && yarn
build:
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run:
name: Build then Export to ./out
command: yarn deploy
test:
working_directory: '~/out'
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run:
name: Run Jest tests
command: yarn test
workflows:
version: 2
build_and_test:
jobs:
- install_deps
- build:
requires:
- install_deps
- test:
requires:
- build
halfer
January 30, 2019, 9:14pm
2
Paste your YAML into this parser . You’ll find that the items you believe are in each run
are in fact at the same level as this key, and so each run step appears to be empty.
https://circleci.com/docs/2.0/sample-config/#sample-configuration-with-sequential-workflow example says to write the yaml like:
steps:
- checkout
- run:
name: Update npm
command: 'sudo npm install -g npm@latest'
Updated my config to:
version: 2
jobs:
install_deps:
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run: npm i -g yarn && yarn
build:
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run: yarn deploy
test:
working_directory: '~/out'
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run: yarn test
workflows:
version: 2
build_and_test:
jobs:
- install_deps
- build:
requires:
- install_deps
- test:
requires:
- build
So it looks more like https://circleci.com/docs/2.0/sample-config/#sample-configuration-with-parallel-jobs example…
Still fails with:
# Config does not conform to schema: {:workflows {:build_and_test {:jobs [nil {:build (not (map? nil)), :requires (not (map? a-clojure.lang.LazySeq))} {:test (not (map? nil)), :requires (not (map? a-clojure.lang.LazySeq))}]}}}
Sidenote: Circle should really look at 999% of use cases and provide examples for various things, like:
Installing Node at a Specific Version
Running npm install
(as well as installing/running yarn
)
Running npm test
Absolutely baffles me that this isn’t what the entire “Getting Started” page is .
For anyone else stumbling upon this, don’t bother learning yet another API. Just run basic stuff in a single &&
separated command. This works:
version: 2
jobs:
build:
docker:
- image: circleci/node:11.8.0
steps:
- checkout
- run: sudo npm i -g yarn@1.13.0 && yarn && yarn test
Don’t care that it’s marked as build
instead of test
or whatever.
halfer
January 31, 2019, 1:04pm
5
More examples are fine up to a point, but I’d argue that it is possible to put too much help into beginners’ material, and it’d have the effect of swamping newbies. I’d recommend doing a file search on GitHub though - there’s many thousands of examples.
That isn’t so good for debugging - if a step fails it may not be easy to see here it fails - especially for the poor dev that has to pick it up.
system
Closed
May 1, 2019, 1:07pm
6
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.