Use CircleCI version 2.1 at the top of your .circleci/config.yml file.
1
version: 2.1
Add the orbs
stanza below your version, invoking the orb:
1
2
orbs:
workflows: aspect-build/workflows@5.8.18
Use workflows
elements in your existing workflows and jobs.
Opt-in to use of uncertified orbs on your organization’s Security settings page.
Continue a pipeline from the setup phase with supplied configuration and pipeline parameters generated from the files changed.
1
2
3
4
5
6
7
8
9
10
11
12
version: '2.1'
setup: true
orbs:
aspect-workflows: aspect-build/workflows@x.x.x
slack: circleci/slack@4.12.5
workflows:
default-workflow:
jobs:
- aspect-workflows/setup:
context:
- slack
resource_class: <circleci-org-name>/aspect-default
Continues a pipeline in the `setup` state with a generated pipeline config which efficiently executes Bazel using Aspect Workflows runners.
PARAMETER | DESCRIPTION | REQUIRED | DEFAULT | TYPE |
---|---|---|---|---|
aspect-config | Path to the Aspect Workflows config.yaml file | No | .aspect/workflows/config.yaml | string |
output-path | Path to save the generated pipeline config to.
| No | /tmp/generated_config.yml | string |
resource_class | Resource class to use to run the generation steps on | No | small | string |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# This code is licensed from CircleCI to the user under the MIT license.
# See here for details: https://circleci.com/developer/orbs/licensing
version: 2.1
description: |
Aspect Workflows is the easiest way to achieve the promised best-case performance for running Bazel on your CI/CD pipeline. Generates a job that runs Bazel, using Aspect Workflows: https://aspect.build/workflows. Includes bazel test, buildozer, gazelle, continuous delivery, and more.
display:
home_url: https://docs.aspect.build/workflows
source_url: https://github.com/aspect-build/workflows-orb
orbs:
continuation: circleci/continuation@1.0.0
jobs:
setup:
description: |
Continues a pipeline in the `setup` state with a generated pipeline config which efficiently executes Bazel using Aspect Workflows runners.
executor: continuation/default
parameters:
aspect-config:
default: .aspect/workflows/config.yaml
description: Path to the Aspect Workflows config.yaml file
type: string
output-path:
default: /tmp/generated_config.yml
description: |
Path to save the generated pipeline config to.
type: string
resource_class:
default: small
description: Resource class to use to run the generation steps on
type: string
resource_class: << parameters.resource_class >>
steps:
- checkout
- run:
command: |
# Need to pass --accept-no-rebase so that we don't exit 2 or 4 if the rebase fails or this is main,
# we are not running under rosetta at this stage to handle the exit code.
/etc/aspect/workflows/bin/rebase --accept-no-rebase
name: Perform rebase
- run:
command: |
rosetta steps --config << parameters.aspect-config >> | tee << parameters.output-path >>
name: Generate config
- continuation/continue:
configuration_path: << parameters.output-path >>
working_directory: /mnt/ephemeral/workdir
examples:
example:
description: |
Continue a pipeline from the setup phase with supplied configuration and pipeline parameters generated from the files changed.
usage:
version: "2.1"
setup: true
orbs:
aspect-workflows: aspect-build/workflows@x.x.x
slack: circleci/slack@4.12.5
workflows:
default-workflow:
jobs:
- aspect-workflows/setup:
context:
- slack
resource_class: <circleci-org-name>/aspect-default