allow to skip preconditions

This commit is contained in:
Yanick Champoux 2025-02-01 12:29:41 -05:00
parent 3d7701985a
commit 9adaa71b2a
3 changed files with 31 additions and 4 deletions

View File

@ -3,6 +3,9 @@
# tea releases c --asset releases/updux-4.0.0-alpha.2.tgz -p --title v4.0.0-alpha.2 --tag v4.0.0-alpha.2 # tea releases c --asset releases/updux-4.0.0-alpha.2.tgz -p --title v4.0.0-alpha.2 --tag v4.0.0-alpha.2
version: '3' version: '3'
env:
SHELL: /usr/local/bin/fish
vars: vars:
PARENT_BRANCH: main PARENT_BRANCH: main
@ -42,13 +45,17 @@ tasks:
integrate: integrate:
deps: [checks] deps: [checks]
env:
NO_NEW_TESTS: '{{.NO_NEW_TESTS}}'
NO_CHANGELOG: '{{.NO_CHANGELOG}}'
PARENT_BRANCH: '{{.PARENT_BRANCH}}'
preconditions: preconditions:
- sh: git is-clean - sh: git is-clean
msg: Workspace is not clean msg: Workspace is not clean
- sh: git diff-ls {{.PARENT_BRANCH}} | grep test - sh: ./contrib/check_new_tests.fish
msg: No test added msg: No test added (NO_NEW_TESTS to disable)
- sh: git diff-ls main | grep .changeset/ - sh: ./contrib/check_changelog.fish
msg: No new changeset msg: No new changeset (NO_CHANGELOG to disable)
cmds: cmds:
- git checkout {{.PARENT_BRANCH}} - git checkout {{.PARENT_BRANCH}}
- git weld - - git weld -
@ -57,6 +64,16 @@ tasks:
test:dev: vitest src test:dev: vitest src
foo:
env:
NO_NEW_TESTS: '{{.NO_NEW_TESTS}}'
PARENT_BRANCH: '{{.PARENT_BRANCH}}'
cmds:
- echo $SHELL
- echo {{.NO_NEW_TESTS}}
- echo $NO_NEW_TESTS
- ./contrib/check_new_tests.fish
lint:fix:delta: lint:fix:delta:
vars: vars:
FILES: FILES:

5
contrib/check_changelog.fish Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env fish
if test -z "$NO_CHANGELOG"
git diff-ls main | grep .changeset/ ;
end

5
contrib/check_new_tests.fish Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env fish
if test -z "$NO_NEW_TESTS"
git diff-ls $PARENT_BRANCH | grep test
end