-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add source-dir to both lint and review workflows (#160)
* feat: closes issue 159 add source-dir to both lint and review workflows for compatibility with monorepos - address PR issues / test failures Co-authored-by: Kyle T <[email protected]>
- Loading branch information
1 parent
c34bc9d
commit 88d47a6
Showing
4 changed files
with
32 additions
and
20 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,19 +1,25 @@ | ||
description: | | ||
Lint all YAML files in the project. A ".yamllint" file will be generated for you automatically by the Orb Development Kit. | ||
docker: | ||
- image: cimg/python:3.10.5 | ||
resource_class: << parameters.resource_class >> | ||
|
||
parameters: | ||
source-dir: | ||
description: Path to the orb source. Path must be absolute or relative to the working directory. | ||
type: string | ||
default: ./src/ | ||
resource_class: | ||
description: Configure the executor resource class | ||
type: enum | ||
enum: ["small", "medium", "medium+", "large", "xlarge", "2xlarge", "2xlarge+"] | ||
default: "medium" | ||
|
||
docker: | ||
- image: cimg/python:3.10.5 | ||
resource_class: << parameters.resource_class >> | ||
|
||
steps: | ||
- checkout | ||
- run: | ||
name: Linting all YAML files | ||
command: <<include(scripts/lint.sh)>> | ||
environment: | ||
ORB_PARAM_SOURCE_DIR: << parameters.source-dir >> |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
#!/bin/bash | ||
if [ ! -d "./src" ]; then | ||
echo "No source directory located at ./src" | ||
echo "This orb assumes you have build your orb using the Orb Development Kit" | ||
if [ ! -d "$ORB_PARAM_SOURCE_DIR" ]; then | ||
echo "No source directory located at $ORB_PARAM_SOURCE_DIR" | ||
echo "This orb assumes you have built your orb using the Orb Development Kit" | ||
echo "https://circleci.com/docs/2.0/orb-author/#orb-development-kit" | ||
fi | ||
pip install --user yamllint | ||
yamllint ./src | ||
yamllint "$ORB_PARAM_SOURCE_DIR" |
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