👷 ci(circleci): add CircleCI configuration file
- create .circleci/config.yml for CI/CD pipeline setup - define parameters for fingerprint, rust version, and flags - include workflows for commit checks, validation, success, and release - utilize toolkit orbs for job execution and management
This commit is contained in:
committed by
Jeremiah Russell
parent
2bcbbd6c04
commit
0428300372
141
.circleci/config.yml
Normal file
141
.circleci/config.yml
Normal file
@@ -0,0 +1,141 @@
|
||||
version: 2.1
|
||||
|
||||
parameters:
|
||||
fingerprint:
|
||||
type: string
|
||||
default: SHA256:OkxsH8Z6Iim6WDJBaII9eTT9aaO1f3eDc6IpsgYYPVg
|
||||
min-rust-version:
|
||||
type: string
|
||||
default: "1.87"
|
||||
release-flag:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "If true, the release workflow will be executed."
|
||||
success-flag:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "If true, the success pipeline will be executed."
|
||||
validation-flag:
|
||||
type: boolean
|
||||
default: false
|
||||
description: "If true, the validation pipeline will be executed."
|
||||
|
||||
orbs:
|
||||
toolkit: jerus-org/circleci-toolkit@2.13.4
|
||||
|
||||
executors:
|
||||
rust-env:
|
||||
docker:
|
||||
- image: jerusdp/ci-rust:<<pipeline.parameters.min-rust-version>>
|
||||
|
||||
workflows:
|
||||
check_last_commit:
|
||||
when:
|
||||
and:
|
||||
- not:
|
||||
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
|
||||
- not: << pipeline.parameters.success-flag >>
|
||||
- not: << pipeline.parameters.release-flag >>
|
||||
- not: << pipeline.parameters.validation-flag >>
|
||||
|
||||
jobs:
|
||||
- toolkit/choose_pipeline:
|
||||
name: choose pipeline based on committer
|
||||
context: bot-check
|
||||
|
||||
validation:
|
||||
when:
|
||||
and:
|
||||
- not:
|
||||
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
|
||||
- not: << pipeline.parameters.success-flag >>
|
||||
- << pipeline.parameters.validation-flag >>
|
||||
- not: << pipeline.parameters.release-flag >>
|
||||
jobs:
|
||||
- toolkit/label:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
context: pcu-app
|
||||
filters:
|
||||
branches:
|
||||
only:
|
||||
- main
|
||||
- toolkit/required_builds:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
- toolkit/optional_builds:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
- toolkit/test_doc_build:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
- toolkit/common_tests:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
- toolkit/idiomatic_rust:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
- toolkit/security:
|
||||
context: SonarCloud
|
||||
- toolkit/update_prlog:
|
||||
filters:
|
||||
branches:
|
||||
ignore:
|
||||
- main
|
||||
requires:
|
||||
- toolkit/required_builds
|
||||
- toolkit/test_doc_build
|
||||
- toolkit/idiomatic_rust
|
||||
- toolkit/security
|
||||
- toolkit/common_tests
|
||||
context:
|
||||
- release
|
||||
- bot-check
|
||||
ssh_fingerprint: << pipeline.parameters.fingerprint >>
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
update_pcu: true
|
||||
|
||||
on_success:
|
||||
when:
|
||||
and:
|
||||
- not:
|
||||
equal: [scheduled_pipeline, << pipeline.trigger_source >>]
|
||||
- << pipeline.parameters.success-flag >>
|
||||
- not: << pipeline.parameters.validation-flag >>
|
||||
- not: << pipeline.parameters.release-flag >>
|
||||
|
||||
jobs:
|
||||
- toolkit/end_success
|
||||
|
||||
release:
|
||||
when:
|
||||
and:
|
||||
- or:
|
||||
- and:
|
||||
- equal: [scheduled_pipeline, << pipeline.trigger_source >>]
|
||||
- equal: ["release check", << pipeline.schedule.name >>]
|
||||
- << pipeline.parameters.release-flag >>
|
||||
- not: << pipeline.parameters.success-flag >>
|
||||
- not: << pipeline.parameters.validation-flag >>
|
||||
jobs:
|
||||
- toolkit/save_next_version:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
|
||||
- toolkit/make_release:
|
||||
requires:
|
||||
- toolkit/save_next_version
|
||||
pre-steps:
|
||||
- attach_workspace:
|
||||
at: /tmp/workspace
|
||||
- run:
|
||||
name: Set SEMVER based on next-version file
|
||||
command: |
|
||||
set +ex
|
||||
export SEMVER=$(cat /tmp/workspace/next-version)
|
||||
echo $SEMVER
|
||||
echo "export SEMVER=$SEMVER" >> "$BASH_ENV"
|
||||
context:
|
||||
- release
|
||||
- bot-check
|
||||
ssh_fingerprint: << pipeline.parameters.fingerprint >>
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
|
||||
- toolkit/no_release:
|
||||
min_rust_version: << pipeline.parameters.min-rust-version >>
|
||||
requires:
|
||||
- toolkit/save_next_version:
|
||||
- failed
|
||||
Reference in New Issue
Block a user