-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #25 from eccenca/develop
prepare release
- Loading branch information
Showing
25 changed files
with
331 additions
and
100 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
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,2 +1 @@ | ||
cmem-plugin-awesome | ||
|
||
*_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
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 |
---|---|---|
|
@@ -3,7 +3,8 @@ | |
version: '3' | ||
|
||
vars: | ||
PLUGIN_DIR: cmem-plugin-awesome | ||
TEMPLATE_REVISION: | ||
sh: git rev-parse HEAD | ||
|
||
tasks: | ||
|
||
|
@@ -17,34 +18,75 @@ tasks: | |
clean: | ||
desc: clean up working directory | ||
cmds: | ||
- rm -rf {{.PLUGIN_DIR}} | ||
- rm -rf *_dir | ||
|
||
create: | ||
desc: create plugin directory with current version and ask for answers | ||
desc: create a project with the current version and ask for answers | ||
deps: | ||
- clean | ||
cmds: | ||
- copier copy --vcs-ref {{.TEMPLATE_REVISION}} . {{.PLUGIN_DIR}} | ||
vars: | ||
TEMPLATE_REVISION: | ||
sh: git rev-parse HEAD | ||
- copier copy --vcs-ref {{.TEMPLATE_REVISION}} . new_dir | ||
|
||
check: | ||
desc: create plugin with default answers and run check | ||
check:generate:case: | ||
desc: generate a project with the current version from a TEST_CASE | ||
preconditions: | ||
- sh: "[[ -v TEST_CASE ]]" | ||
msg: > | ||
Environment needs 'TEST_CASE' variable. | ||
See tests directory - all yaml files without suffix are test cases. | ||
- sh: "[ -f tests/${TEST_CASE}.yml ]" | ||
msg: Test case file ${TEST_CASE}.yml does not exist. | ||
cmds: | ||
- rm -rf {{.TEST_CASE}}_dir | ||
- mkdir {{.TEST_CASE}}_dir | ||
- cp tests/{{.TEST_CASE}}.yml {{.TEST_CASE}}_dir/.copier-answers.yml | ||
- copier copy --vcs-ref {{.TEMPLATE_REVISION}} --defaults . {{.TEST_CASE}}_dir | ||
- git config --global init.defaultBranch develop | ||
- cd {{.TEST_CASE}}_dir && git init . | ||
- cd {{.TEST_CASE}}_dir && git add . | ||
- cd {{.TEST_CASE}}_dir && git config init.defaultBranch main | ||
- cd {{.TEST_CASE}}_dir && git config user.name "Anonymous Person" | ||
- cd {{.TEST_CASE}}_dir && git config user.email "[email protected]" | ||
- cd {{.TEST_CASE}}_dir && git commit -m "init from template" | ||
|
||
check:generate:cases: | ||
desc: generate all test cases with the current template version | ||
deps: | ||
- clean | ||
vars: | ||
TEST_CASES: | ||
sh: find tests -type f -name '*.yml' | sed 's/^tests\///g' | sed 's/\.yml$//g' | ||
cmds: | ||
- copier copy --vcs-ref {{.TEMPLATE_REVISION}} --defaults . {{.PLUGIN_DIR}} | ||
- git config --global init.defaultBranch develop | ||
- git init {{.PLUGIN_DIR}} | ||
- cd {{.PLUGIN_DIR}} && git add . | ||
- cd {{.PLUGIN_DIR}} && git config init.defaultBranch main | ||
- cd {{.PLUGIN_DIR}} && git config user.name "Anonymous Person" | ||
- cd {{.PLUGIN_DIR}} && git config user.email "[email protected]" | ||
- cd {{.PLUGIN_DIR}} && git commit -m "init from template" | ||
- cd {{.PLUGIN_DIR}} && poetry update | ||
- cd {{.PLUGIN_DIR}} && task check | ||
- for: { var: TEST_CASES } | ||
cmd: TEST_CASE={{.ITEM}} task check:generate:case | ||
|
||
check:validate:case: | ||
desc: validate a project test case | ||
preconditions: | ||
- sh: "[[ -v TEST_CASE ]]" | ||
msg: > | ||
Environment needs 'TEST_CASE' variable. | ||
See tests directory - all yaml files without suffix are test cases. | ||
- sh: "[ -d ${TEST_CASE}_dir ]" | ||
msg: > | ||
Test case directory ${TEST_CASE}.yml does not exist. | ||
Please use check:generate* tasks to create directories. | ||
cmds: | ||
- cd {{.TEST_CASE}}_dir && poetry update | ||
- cd {{.TEST_CASE}}_dir && task check | ||
|
||
check:validate:cases: | ||
desc: validate all test cases | ||
vars: | ||
TEMPLATE_REVISION: | ||
sh: git rev-parse HEAD | ||
TEST_CASES: | ||
sh: find tests -type f -name '*.yml' | sed 's/^tests\///g' | sed 's/\.yml$//g' | ||
cmds: | ||
- for: { var: TEST_CASES } | ||
cmd: TEST_CASE={{.ITEM}} task check:validate:case | ||
|
||
check: | ||
desc: First generate, the validate all test cases | ||
cmds: | ||
- task: check:generate:cases | ||
- task: check:validate:cases | ||
|
Oops, something went wrong.