This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 35
/
config.yml
95 lines (90 loc) · 3.8 KB
/
config.yml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
version: 2.1
orbs:
# Replace this with your own!
<orb-name>: <namespace>/<orb-name>@<<pipeline.parameters.dev-orb-version>>
orb-tools: circleci/orb-tools@10.0
bats: circleci/bats@1.0
shellcheck: circleci/shellcheck@2.0
# Pipeline Parameters
## These parameters are used internally by orb-tools. Skip to the Jobs section.
parameters:
run-integration-tests:
description: An internal flag to prevent integration test from running before a development version has been created.
type: boolean
default: false
dev-orb-version:
description: >
The development version of the orb to test.
This value is automatically adjusted by the "trigger-integration-tests-workflow" job to correspond with the specific version created by the commit and should not be edited.
A "dev:alpha" version must exist for the initial pipeline run.
type: string
default: "dev:alpha"
jobs:
# Define one or more jobs which will utilize your orb's commands and parameters to validate your changes.
integration-test-1:
docker:
- image: cimg/base:stable
steps:
- checkout
# "greet" is a sample command packaged with this orb config.
# This sample integration test will run as long as the greet command exists. Once you remove the greet command you should remove this line.
# Push new changes first, before adding new tests to your config.
- <orb-name>/greet
workflows:
# Prior to producing a development orb (which requires credentials) basic validation, linting, and even unit testing can be performed.
# This workflow will run on every commit
test-pack:
unless: << pipeline.parameters.run-integration-tests >>
jobs:
- orb-tools/lint # Lint Yaml files
- orb-tools/pack # Pack orb source
- shellcheck/check:
dir: ./src/scripts
exclude: SC2148
# optional: Run BATS tests against your scripts
- bats/run:
path: ./src/tests
# Publish development version(s) of the orb.
- orb-tools/publish-dev:
orb-name: <namespace>/<orb-name>
context: <publishing-context> # A restricted context containing your private publishing credentials. Will only execute if approved by an authorized user.
requires:
- orb-tools/lint
- orb-tools/pack
- bats/run
- shellcheck/check
# Trigger an integration workflow to test the
# dev:${CIRCLE_SHA1:0:7} version of your orb
- orb-tools/trigger-integration-tests-workflow:
name: trigger-integration-dev
context: <publishing-context>
requires:
- orb-tools/publish-dev
# This `integration-test_deploy` workflow will only run
# when the run-integration-tests pipeline parameter is set to true.
# It is meant to be triggered by the "trigger-integration-tests-workflow"
# job, and run tests on <your orb>@dev:${CIRCLE_SHA1:0:7}.
integration-test_deploy:
when: << pipeline.parameters.run-integration-tests >>
jobs:
# Run any integration tests defined within the `jobs` key.
- integration-test-1
# Publish a semver version of the orb. relies on
# the commit subject containing the text "[semver:patch|minor|major|skip]"
# as that will determine whether a patch, minor or major
# version will be published or if publishing should
# be skipped.
# e.g. [semver:patch] will cause a patch version to be published.
- orb-tools/dev-promote-prod-from-commit-subject:
orb-name: <namespace>/<orb-name>
context: <publishing-context>
add-pr-comment: false
fail-if-semver-not-indicated: true
publish-version-tag: false
requires:
- integration-test-1
filters:
branches:
only:
- master
- main