Steps within a job, with commands like restore_cache
Description
I'm not sure if this is a good idea or not, but looking at the new CircleCI 2.0 syntax, they let you declare steps within a single job, which isn't really new, but what they've done is given you control over steps outside our normal script operation. Like you can determine when you want to restore_cache. They used to be all about the magic (inference), but now have moved even farther towards explicitness than we have. I'm not sure if these steps are overriding otherwise default steps, or if nothing is default anymore, and if you left out the checkout step, for example, would it actually not checkout? I'm guessing the latter.
e.g. https://github.com/VividcodeIO/feature9/blob/master/circle.yml
version: 2
jobs:
build:
working_directory: ~/circleci-feature9
docker:
- image: maven:3.5.0-jdk-9
steps:
- checkout
- restore_cache:
key: circleci-feature9-{{ checksum "pom.xml" }}
- run: mvn test
- save_cache:
paths:
- ~/.m2
key: circleci-feature9-{{ checksum "pom.xml" }}
- store_test_results:
path: target/surefire-reports
Proposal
Links / references
Documentation blurb
Overview
What is it? Why should someone use this feature? What is the underlying (business) problem? How do you use this feature?
Use cases
Who is this for? Provide one or more use cases.
Feature checklist
Make sure these are completed before closing the issue, with a link to the relevant commit.
-
Feature assurance -
Documentation -
Added to features.yml