YAML Configuration for CircleCI Pipelines for Continuous Integration
How can I configure a CircleCI pipeline using YAML?
version: Specifies the CircleCI configuration version.orbs: Imports pre-packaged configurations.jobs: Defines individual tasks.workflows: Orchestrates the execution of jobs.
version: 2.1
orbs:
node: circleci/node@5.1.0
jobs:
build:
docker:
- image: cimg/node:18.19
steps:
- checkout
- node/install-packages: # Use a pre-packaged job
pkg-manager: npm
- run:
name: Run tests
command: npm test
workflows:
version: 2
build-and-test:
jobs:
- build
version: 2.1orbs: node: circleci/node@5.1.0checkout: Checks out your code.run: Executes shell commands.save_cache / restore_cache: Caches dependencies to speed up builds.run step:
- run:
name: Install dependencies
command: npm install
workflows:
version: 2
build-and-test:
jobs:
- build
Know the answer? Login to help.
Login to Answer