-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
93 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,109 +1,37 @@ | ||
version: 2.1 | ||
|
||
# add your orb below, to be used in integration tests (note: a @dev:alpha | ||
# release must exist.); | ||
setup: true | ||
orbs: | ||
gradle: circleci/gradle@dev:alpha | ||
orb-tools: circleci/[email protected] | ||
|
||
# Pipeline parameters | ||
parameters: | ||
# These pipeline parameters are required by the "trigger-integration-tests-workflow" | ||
# job, by default. | ||
run-integration-tests: | ||
type: boolean | ||
default: false | ||
dev-orb-version: | ||
type: string | ||
default: "dev:alpha" | ||
orb-tools: circleci/[email protected] | ||
shellcheck: circleci/[email protected] | ||
|
||
jobs: | ||
# This job is an example of an integration testing job. | ||
# This job should execute a command from your orb and verify | ||
# the output is as expected, otherwise the job should fail. | ||
# | ||
# Rename this job and add more as needed. | ||
# | ||
integration-test-1: | ||
executor: gradle/default | ||
steps: | ||
- checkout | ||
- run: | ||
name: Check if Gradle is installed | ||
command: | | ||
if [[ $(command -v gradle) == "" ]]; then | ||
echo " Gradle is not installed! "; exit 1; | ||
else | ||
echo Gradle successfully installed. | ||
fi | ||
filters: &filters | ||
tags: | ||
only: /.*/ | ||
|
||
workflows: | ||
# This `lint-pack_validate_publish-dev` workflow will run on any commit. | ||
lint_pack-validate_publish-dev: | ||
unless: << pipeline.parameters.run-integration-tests >> | ||
lint-pack: | ||
jobs: | ||
- orb-tools/lint | ||
# pack your orb YAML files to a single orb.yml | ||
# validate the orb.yml file to ensure it is well-formed | ||
- orb-tools/lint: | ||
filters: *filters | ||
- orb-tools/pack: | ||
requires: | ||
- orb-tools/lint | ||
|
||
# release dev version of orb, for testing & possible publishing. | ||
# orb will be published as dev:alpha and dev:${CIRCLE_SHA1:0:7}. | ||
# requires a CircleCI API token to be stored as CIRCLE_TOKEN (default) | ||
# https://circleci.com/docs/2.0/managing-api-tokens | ||
# store CIRCLE_TOKEN as a project env var or Contexts resource | ||
# if using Contexts, add your context below | ||
- orb-tools/publish-dev: | ||
filters: *filters | ||
- orb-tools/review: | ||
filters: *filters | ||
- shellcheck/check: | ||
exclude: SC2148,SC2038,SC2086,SC2002,SC2016 | ||
filters: *filters | ||
- orb-tools/publish: | ||
orb-name: circleci/gradle | ||
context: orb-publisher | ||
requires: | ||
- orb-tools/pack | ||
|
||
# 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: orb-publisher | ||
vcs-type: << pipeline.project.type >> | ||
requires: | ||
- orb-tools/publish-dev | ||
|
||
# This `integration-tests_prod-release` 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-tests_prod-release: | ||
when: << pipeline.parameters.run-integration-tests >> | ||
jobs: | ||
# your integration test jobs go here: essentially, run all your orb's | ||
# jobs and commands to ensure they behave as expected. or, run other | ||
# integration tests of your choosing | ||
|
||
# an example job | ||
- integration-test-1 | ||
- gradle/test: | ||
app_src_directory: sample_app | ||
reports_path: sample_app/build/reports/ | ||
test_results_path: sample_app/build/test-results/ | ||
|
||
# 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: circleci/gradle | ||
[orb-tools/lint, orb-tools/review, orb-tools/pack, shellcheck/check] | ||
# Use a context to hold your publishing token. | ||
context: orb-publisher | ||
add-pr-comment: true | ||
bot-token-variable: GHI_TOKEN | ||
bot-user: orb-publisher | ||
fail-if-semver-not-indicated: true | ||
publish-version-tag: false | ||
requires: | ||
- integration-test-1 | ||
- gradle/test | ||
filters: | ||
branches: | ||
only: master | ||
filters: *filters | ||
github-token: GHI_TOKEN | ||
# Triggers the next workflow in the Orb Development Kit. | ||
- orb-tools/continue: | ||
pipeline-number: << pipeline.number >> | ||
vcs-type: << pipeline.project.type >> | ||
requires: [orb-tools/publish] | ||
filters: *filters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: 2.1 | ||
orbs: | ||
gradle: circleci/gradle@dev:<<pipeline.git.revision>> | ||
orb-tools: circleci/[email protected] | ||
filters: &filters | ||
tags: | ||
only: /.*/ | ||
jobs: | ||
# This job is an example of an integration testing job. | ||
# This job should execute a command from your orb and verify | ||
# the output is as expected, otherwise the job should fail. | ||
# | ||
# Rename this job and add more as needed. | ||
# | ||
integration-test-1: | ||
executor: gradle/default | ||
steps: | ||
- checkout | ||
- run: | ||
name: Check if Gradle is installed | ||
command: |- | ||
if [[ $(command -v gradle) == "" ]]; then | ||
echo " Gradle is not installed! "; exit 1; | ||
else | ||
echo Gradle successfully installed. | ||
fi | ||
workflows: | ||
test-deploy: | ||
jobs: | ||
- integration-test-1: | ||
filters: *filters | ||
- gradle/test: | ||
app_src_directory: sample_app | ||
reports_path: sample_app/build/reports/ | ||
test_results_path: sample_app/build/test-results/ | ||
filters: *filters | ||
- orb-tools/pack: | ||
filters: *filters | ||
- orb-tools/publish: | ||
orb-name: circleci/gradle | ||
vcs-type: << pipeline.project.type >> | ||
pub-type: production | ||
github-token: GHI_TOKEN | ||
requires: | ||
- orb-tools/pack | ||
- integration-test-1 | ||
- gradle/test | ||
context: orb-publisher | ||
filters: | ||
branches: | ||
ignore: /.*/ | ||
tags: | ||
only: /^v[0-9]+\.[0-9]+\.[0-9]+$/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
extends: relaxed | ||
|
||
rules: | ||
line-length: | ||
max: 200 | ||
allow-non-breakable-inline-mappings: true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
find . -name "${PARAM_CHECKSUM_FILES}" | sort | xargs cat | shasum | awk '{print $1}' > /tmp/gradle_cache_seed |