chore: upgrade to Aspect Workflows 5.9.0-rc.15 (#722)

This commit is contained in:
Greg Magolan 2024-01-13 13:38:51 -08:00 committed by GitHub
parent 5b3b7d7794
commit 5c7e759733
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 933 additions and 44 deletions

View File

@ -0,0 +1,13 @@
load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
exports_files(["config.yaml"])
bzl_library(
name = "deps",
srcs = ["deps.bzl"],
visibility = ["//visibility:public"],
deps = [
"@bazel_tools//tools/build_defs/repo:http.bzl",
"@bazel_tools//tools/build_defs/repo:utils.bzl",
],
)

View File

@ -0,0 +1,48 @@
"""Bazel dependencies for Aspect Workflows"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", _http_archive = "http_archive", _http_file = "http_file")
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
# TODO: move this to a rule set so repositories on Aspect Workflows can avoid this boilerplate
rosetta_version = "5.9.0-rc.15"
rosetta_integrity = {
"darwin_aarch64": "sha256-qBvrzIuFu1yc/fQRGX0xEESPB9F3CnNvcN3vbh7n36A=",
"darwin_x86_64": "sha256-WBKYuUhNgYJ5hKWK0jqkehTTKjkTA/4J1wHXs451zzY=",
"linux_aarch64": "sha256-hR4C3gLa668zQingdchz0uB5g4kaIYCYiklQVqHWbPE=",
"linux_x86_64": "sha256-xynht34OBsMCQT6/KsNCePxppCFZEYGrMkQ9fsapfdg=",
}
# https://github.com/suzuki-shunsuke/circleci-config-merge/releases
# https://dev.to/suzukishunsuke/splitting-circleci-config-yml-10gk
circleci_config_merge_version = "1.1.6"
circleci_config_merge_integrity = {
"darwin_aarch64": "sha256-7cQeLrSVRZR+mQu/njn+x//EIb2bhTV2+J8fafRHpr4=",
"darwin_x86_64": "sha256-vHKDSdDaYK58MaudJ9yOPRKh+OT/LiTQV/9E07RL8qA=",
"linux_aarch64": "sha256-MaXVQmRK9q9LgsfM5ZzxCIIT8rUcOBbzJ8aVDgK6zWs=",
"linux_x86_64": "sha256-3eYJn7dShZD1oiS3cgXfqXwdDzclf/N97A2nh7ZfW+w=",
}
def http_archive(name, **kwargs):
maybe(_http_archive, name = name, **kwargs)
def http_file(name, **kwargs):
maybe(_http_file, name = name, **kwargs)
# buildifier: disable=function-docstring
def fetch_workflows_deps():
for platform_arch in rosetta_integrity.keys():
http_file(
name = "rosetta_{}".format(platform_arch),
downloaded_file_path = "rosetta",
executable = True,
integrity = rosetta_integrity[platform_arch],
urls = ["https://static.aspect.build/aspect/{0}/rosetta_real_{1}".format(rosetta_version, platform_arch.replace("aarch64", "arm64"))],
)
for platform_arch in circleci_config_merge_integrity.keys():
http_archive(
name = "circleci_config_merge_{}".format(platform_arch),
build_file_content = "exports_files([\"circleci-config-merge\"])",
integrity = circleci_config_merge_integrity[platform_arch],
urls = ["https://github.com/suzuki-shunsuke/circleci-config-merge/releases/download/v{0}/circleci-config-merge_{0}_{1}.tar.gz".format(circleci_config_merge_version, platform_arch.replace("aarch64", "arm64").replace("x86_64", "amd64"))],
)

View File

@ -16,7 +16,7 @@ module "aspect_workflows" {
region = local.region region = local.region
# Aspect Workflows terraform module # Aspect Workflows terraform module
source = "https://s3.us-east-2.amazonaws.com/static.aspect.build/aspect/5.9.0-rc.10/workflows-gcp/terraform-gcp-aspect-workflows.zip" source = "https://s3.us-east-2.amazonaws.com/static.aspect.build/aspect/5.9.0-rc.15/workflows-gcp/terraform-gcp-aspect-workflows.zip"
# Network properties # Network properties
network = google_compute_network.workflows_network.id network = google_compute_network.workflows_network.id

50
.circleci/BUILD.bazel Normal file
View File

@ -0,0 +1,50 @@
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_file")
CIRCLECI_ORG = "aspect-build"
CIRCLECI_USER_CONFIG_FILE = "//.circleci:user-config.yml"
alias(
name = "rosetta",
actual = select({
"@bazel_tools//src/conditions:darwin_arm64": "@rosetta_darwin_aarch64//file:rosetta",
"@bazel_tools//src/conditions:darwin_x86_64": "@rosetta_darwin_x86_64//file:rosetta",
"@bazel_tools//src/conditions:linux_aarch64": "@rosetta_linux_aarch64//file:rosetta",
"@bazel_tools//src/conditions:linux_x86_64": "@rosetta_linux_x86_64//file:rosetta",
}),
)
alias(
name = "circleci-config-merge",
actual = select({
"@bazel_tools//src/conditions:darwin_arm64": "@circleci_config_merge_darwin_aarch64//:circleci-config-merge",
"@bazel_tools//src/conditions:darwin_x86_64": "@circleci_config_merge_darwin_x86_64//:circleci-config-merge",
"@bazel_tools//src/conditions:linux_aarch64": "@circleci_config_merge_linux_aarch64//:circleci-config-merge",
"@bazel_tools//src/conditions:linux_x86_64": "@circleci_config_merge_linux_x86_64//:circleci-config-merge",
}),
)
genrule(
name = "aspect_workflows_config",
srcs = ["//.aspect/workflows:config.yaml"],
outs = [":aspect-workflows-config.yml"],
cmd = "CIRCLE_PROJECT_USERNAME={0} $(execpath :rosetta) steps --configuration .aspect/workflows/config.yaml --host circleci > $@".format(CIRCLECI_ORG),
tools = [":rosetta"],
)
genrule(
name = "merge_config",
srcs = [
":aspect-workflows-config.yml",
CIRCLECI_USER_CONFIG_FILE,
],
outs = [":_config.yml"],
cmd = "echo -e '# GENERATED FILE - DO NOT EDIT!\\n# Update with: bazel run //.circleci:write_merged_config' > $@ && $(execpath :circleci-config-merge) merge $(execpath :aspect-workflows-config.yml) $(execpath {0}) >> $@".format(CIRCLECI_USER_CONFIG_FILE),
tools = [":circleci-config-merge"],
)
write_source_file(
name = "write_merged_config",
in_file = ":_config.yml",
out_file = "config.yml",
)

View File

@ -1,46 +1,765 @@
# GENERATED FILE - DO NOT EDIT!
# Update with: bazel run //.circleci:write_merged_config
version: 2.1 version: 2.1
parameters:
perform_delivery:
type: boolean
default: false
delivery_commit:
type: string
default: ""
description: The commit to checkout and run the delivery from
delivery_targets:
type: string
default: ""
description: Ignore the target(s) that are listed in the delivery manifest
and instead deliver these targets. Comma-separated list of labels.
# enable CircleCI's dynamic configuration feature
setup: true
orbs:
slack: circleci/slack@4.12.5
aspect-workflows: aspect-build/workflows@dev:5.9.0-rc.10
jobs:
legacy:
docker:
- image: cimg/base:2023.03
steps:
- run: echo "No-op step since CCI requires one step for the job to be valid"
- when:
condition:
and:
- not:
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
steps:
- checkout
- run: echo "This is an example of legacy non-workflows job"
workflows: workflows:
default-workflow: aspect-workflows:
jobs: jobs:
- legacy - aw-auto-deliver:
- aspect-workflows/setup: context: []
resource_class: aspect-build/bazel-lib-nano filters:
context: branches:
- slack only:
- main
- aspect-build/test-delivery
requires:
- aw-root_workspace_test
- aw-buildifier:
context: []
workspace: .
- aw-configure:
context: []
workspace: .
- aw-format:
context: []
workspace: .
- aw-gazelle:
context: []
workspace: .
- aw-root_workspace_test:
context: []
workspace: .
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- scheduled_pipeline
- << pipeline.trigger_source >>
aspect-workflows-e2e-copy_to_directory:
jobs:
- aw-test:
context: []
delivery_manifest: false
workspace: e2e/copy_to_directory
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- scheduled_pipeline
- << pipeline.trigger_source >>
aspect-workflows-e2e-coreutils:
jobs:
- aw-test:
context: []
delivery_manifest: false
workspace: e2e/coreutils
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- scheduled_pipeline
- << pipeline.trigger_source >>
aspect-workflows-e2e-external_copy_to_directory:
jobs:
- aw-test:
context: []
delivery_manifest: false
workspace: e2e/external_copy_to_directory
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- scheduled_pipeline
- << pipeline.trigger_source >>
aspect-workflows-e2e-smoke:
jobs:
- aw-test:
context: []
delivery_manifest: false
workspace: e2e/smoke
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- scheduled_pipeline
- << pipeline.trigger_source >>
aspect-workflows-manual-deliver:
jobs:
- aw-manual-deliver:
context: []
when:
equal:
- true
- << pipeline.parameters.perform_delivery >>
aspect-workflows-warming:
jobs:
- aw-warming: {}
when:
and:
- equal:
- scheduled_pipeline
- << pipeline.trigger_source >>
- equal:
- aspect-workflows-warming
- << pipeline.schedule.name >>
user-workflow:
jobs:
- user-job
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- << pipeline.trigger_source >>
- scheduled_pipeline
jobs:
aw-auto-deliver:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
resource_class: aspect-build/bazel-lib
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: git fetch
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Git fetch
- when:
condition: << pipeline.parameters.delivery_commit >>
steps:
- run:
command: git checkout << pipeline.parameters.delivery_commit >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Checkout release commit
- run:
command: rosetta run delivery
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Delivery
no_output_timeout: 180m
working_directory: /mnt/ephemeral/workdir
aw-buildifier:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
parameters:
delivery_manifest:
default: true
type: boolean
workspace:
type: string
resource_class: aspect-build/bazel-lib-small
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: rm -rf /some/path/artifacts /some/path/testlogs
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Prepare archive directories
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run branch_freshness
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Branch Freshness
no_output_timeout: 180m
- run:
command: rosetta run buildifier --workspace << parameters.workspace >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Buildifier
no_output_timeout: 180m
- store_artifacts:
path: /some/path/artifacts
- run:
command: rosetta run finalization
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Finalization
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-configure:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
parameters:
delivery_manifest:
default: true
type: boolean
workspace:
type: string
resource_class: aspect-build/bazel-lib-small
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: rm -rf /some/path/artifacts /some/path/testlogs
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Prepare archive directories
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run branch_freshness
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Branch Freshness
no_output_timeout: 180m
- run:
command: rosetta run configure --workspace << parameters.workspace >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure
no_output_timeout: 180m
- store_artifacts:
path: /some/path/artifacts
- run:
command: rosetta run finalization
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Finalization
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-format:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
parameters:
delivery_manifest:
default: true
type: boolean
workspace:
type: string
resource_class: aspect-build/bazel-lib-small
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: rm -rf /some/path/artifacts /some/path/testlogs
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Prepare archive directories
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run branch_freshness
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Branch Freshness
no_output_timeout: 180m
- run:
command: rosetta run format --workspace << parameters.workspace >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Format
no_output_timeout: 180m
- store_artifacts:
path: /some/path/artifacts
- run:
command: rosetta run finalization
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Finalization
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-gazelle:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
parameters:
delivery_manifest:
default: true
type: boolean
workspace:
type: string
resource_class: aspect-build/bazel-lib-small
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: rm -rf /some/path/artifacts /some/path/testlogs
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Prepare archive directories
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run branch_freshness
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Branch Freshness
no_output_timeout: 180m
- run:
command: rosetta run gazelle --workspace << parameters.workspace >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Gazelle
no_output_timeout: 180m
- store_artifacts:
path: /some/path/artifacts
- run:
command: rosetta run finalization
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Finalization
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-manual-deliver:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
DELIVERY_TARGETS: << pipeline.parameters.delivery_targets >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
resource_class: aspect-build/bazel-lib
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: git fetch
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Git fetch
- when:
condition: << pipeline.parameters.delivery_commit >>
steps:
- run:
command: git checkout << pipeline.parameters.delivery_commit >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Checkout release commit
- run:
command: rosetta run delivery
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
DELIVERY_COMMIT: << pipeline.parameters.delivery_commit >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Delivery
no_output_timeout: 180m
working_directory: /mnt/ephemeral/workdir
aw-root_workspace_test:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
parameters:
delivery_manifest:
default: true
type: boolean
workspace:
type: string
resource_class: aspect-build/bazel-lib
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: rm -rf /some/path/artifacts /some/path/testlogs
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Prepare archive directories
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run branch_freshness
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Branch Freshness
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Test
no_output_timeout: 180m
- store_test_results:
path: /some/path/testlogs
- when:
condition:
and:
- <<parameters.delivery_manifest>>
- or:
- equal:
- main
- << pipeline.git.branch >>
- equal:
- aspect-build/test-delivery
- << pipeline.git.branch >>
steps:
- run:
command: rosetta run delivery_manifest --workspace << parameters.workspace
>> --data TARGETS_SOURCE=test
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Delivery Manifest
no_output_timeout: 180m
- store_artifacts:
path: /some/path/testlogs
- store_artifacts:
path: /some/path/artifacts
- run:
command: rosetta run finalization
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Finalization
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-test:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >>
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
parameters:
delivery_manifest:
default: true
type: boolean
workspace:
type: string
resource_class: aspect-build/bazel-lib-small
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: rm -rf /some/path/artifacts /some/path/testlogs
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Prepare archive directories
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run branch_freshness
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Branch Freshness
no_output_timeout: 180m
- run:
command: rosetta run test --workspace << parameters.workspace >>
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Test
no_output_timeout: 180m
- store_test_results:
path: /some/path/testlogs
- when:
condition:
and:
- <<parameters.delivery_manifest>>
- or:
- equal:
- main
- << pipeline.git.branch >>
- equal:
- aspect-build/test-delivery
- << pipeline.git.branch >>
steps:
- run:
command: rosetta run delivery_manifest --workspace << parameters.workspace
>> --data TARGETS_SOURCE=test
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Delivery Manifest
no_output_timeout: 180m
- store_artifacts:
path: /some/path/testlogs
- store_artifacts:
path: /some/path/artifacts
- run:
command: rosetta run finalization
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Finalization
no_output_timeout: 10m
when: always
working_directory: /mnt/ephemeral/workdir
aw-warming:
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
XDG_CACHE_HOME: /mnt/ephemeral/caches
machine: true
resource_class: aspect-build/bazel-lib-small-warming
steps:
- run:
command: /etc/aspect/workflows/bin/configure_workflows_env
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Configure Workflows
- checkout
- run:
command: /etc/aspect/workflows/bin/agent_health_check
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Agent health checks
no_output_timeout: 180m
- run:
command: rosetta run warming --workspace e2e/external_copy_to_directory
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Create warming archive for e2e/external_copy_to_directory
no_output_timeout: 180m
- run:
command: rosetta run warming --workspace e2e/copy_to_directory
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Create warming archive for e2e/copy_to_directory
no_output_timeout: 180m
- run:
command: rosetta run warming --workspace e2e/coreutils
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Create warming archive for e2e/coreutils
no_output_timeout: 180m
- run:
command: rosetta run warming --workspace e2e/smoke
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Create warming archive for e2e/smoke
no_output_timeout: 180m
- run:
command: rosetta run warming --workspace .
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Create warming archive for root
no_output_timeout: 180m
- run:
command: /etc/aspect/workflows/bin/warming_archive
environment:
ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml
CC: /bin/false
XDG_CACHE_HOME: /mnt/ephemeral/caches
name: Archive warming tars
working_directory: /mnt/ephemeral/workdir
user-job:
docker:
- image: cimg/base:2023.03
steps:
- checkout
- run: echo "Example user CircleCI job that is not generated by Aspect Workflows."
parameters:
delivery_commit:
default: ""
description: The commit to checkout and run the delivery from. Targets listed
in the delivery manifest for this commit will be delivered unless specific targets
are listed in `delivery_targets`.
type: string
delivery_targets:
default: ""
description: List of Bazel targets to deliver, delimited by spaces. For example,
`//app/a:push_release //app/b:push_release`. If empty, targets listed in the
delivery manifest for the target commit will be delivered.
type: string
perform_delivery:
default: false
type: boolean

54
.circleci/user-config.yml Normal file
View File

@ -0,0 +1,54 @@
# This is an example of a user CircleCI configuration that is not generated by
# Aspect Workflows. The naming of this file is arbitrary. This configuration is
# merged with the generated Aspect Workflows CircleCI configuration into the
# load bearing load `.circleci/config.yaml` configuration file that is used by
# CircleCI.
#
# To update `.circleci/config.yaml` after editing this file run:
#
# bazel run //.circleci:write_merged_config
#
#
# Aspect Workflows workflow names are all prefixed with "aspect-workflows-".
# These currently include:
#
# - aspect-workflows
# - aspect-workflows-warming
# - aspect-workflows-manual-deliver
#
# Aspect Workflows job names are all prefixed with "aw-". These currently
# include.
#
# - aw-auto-deliver
# - aw-buildifier
# - aw-configure
# - aw-format
# - aw-gazelle
# - aw-manual-deliver
# - aw-test
# - aw-warming
#
# In your user CircleCI configuration, avoid workflow names prefixed with
# `aspect-workflows-` and job names prefixed with `aw-`. Conflicting workflow or
# job names will result in a bad configuration merge.
version: 2.1
jobs:
user-job:
docker:
- image: cimg/base:2023.03
steps:
- checkout
- run: echo "Example user CircleCI job that is not generated by Aspect Workflows."
workflows:
user-workflow:
jobs:
- user-job
when:
and:
- not: << pipeline.parameters.perform_delivery >>
- not:
equal:
- << pipeline.trigger_source >>
- scheduled_pipeline

View File

@ -1,3 +1,4 @@
.circleci/config.yml
docs/*.md docs/*.md
e2e/*/docs.md e2e/*/docs.md
lib/tests/jq/*.json lib/tests/jq/*.json

View File

@ -81,3 +81,7 @@ load(
fetch_shfmt() fetch_shfmt()
fetch_terraform() fetch_terraform()
load("//.aspect/workflows:deps.bzl", "fetch_workflows_deps")
fetch_workflows_deps()