From be5c25b3be7c8bb3b9ce1399ba09d6649cbcf0cc Mon Sep 17 00:00:00 2001 From: Abhijeet Saroha <108522472+abhijeetSaroha@users.noreply.github.com> Date: Fri, 4 Oct 2024 21:01:17 +0530 Subject: [PATCH] feat: Change dependencies to hooks (#115) --- .makim.yaml | 55 ++++++++++++------ docs/tutorials/introduction/index.ipynb | 55 +++++++++--------- .../tutorials/makim-for-nox-users/.makim.yaml | 7 ++- .../tutorials/makim-for-nox-users/index.ipynb | 7 ++- src/makim/core.py | 42 +++++++------- tests/smoke/.makim-bash-group-scope.yaml | 5 +- tests/smoke/.makim-bash-task-scope.yaml | 5 +- tests/smoke/.makim-complex.yaml | 57 +++++++++++-------- tests/smoke/.makim-dir-absolute-path.yaml | 45 +++++++++------ tests/smoke/.makim-dir-no-path.yaml | 45 +++++++++------ tests/smoke/.makim-dir-relative-path.yaml | 45 +++++++++------ tests/smoke/.makim-env.yaml | 9 +-- tests/smoke/.makim-hooks.yaml | 40 +++++++++++++ tests/smoke/.makim-interpreters.yaml | 17 +++--- tests/smoke/.makim-simple.yaml | 11 ++-- tests/smoke/.makim-sugar.yaml | 5 +- tests/smoke/.makim-unittest.yaml | 38 +++++++------ 17 files changed, 298 insertions(+), 190 deletions(-) create mode 100644 tests/smoke/.makim-hooks.yaml diff --git a/.makim.yaml b/.makim.yaml index ff8ee05..f694b93 100644 --- a/.makim.yaml +++ b/.makim.yaml @@ -72,26 +72,29 @@ groups: smoke: help: Run smoke tests - dependencies: - - task: smoke-tests.simple - - task: smoke-tests.complex - - task: smoke-tests.containers - - task: smoke-tests.unittest - - task: smoke-tests.vars-env - - task: smoke-tests.test-vars - - task: smoke-tests.bash - - task: smoke-tests.dir-absolute-path - - task: smoke-tests.dir-no-path - - task: smoke-tests.dir-relative-path - - task: smoke-tests.interactive-args + hooks: + pre-run: + - task: smoke-tests.simple + - task: smoke-tests.complex + - task: smoke-tests.containers + - task: smoke-tests.unittest + - task: smoke-tests.vars-env + - task: smoke-tests.test-vars + - task: smoke-tests.bash + - task: smoke-tests.dir-absolute-path + - task: smoke-tests.dir-no-path + - task: smoke-tests.dir-relative-path + - task: smoke-tests.interactive-args + - task: smoke-tests.run-hooks ci: help: Run all tasks used on CI - dependencies: - - task: tests.linter - - task: tests.unittest - - task: tests.smoke - - task: docs.build + hooks: + pre-run: + - task: tests.linter + - task: tests.unittest + - task: tests.smoke + - task: docs.build smoke-tests: tasks: @@ -356,7 +359,7 @@ groups: action: store_true env: MAKIM_FILE: tests/smoke/.makim-interactive-args.yaml - shell: bash + backend: bash run: | export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' makim $VERBOSE_FLAG --file $MAKIM_FILE --help @@ -372,6 +375,22 @@ groups: exit 1 fi + run-hooks: + help: Test makim with pre-run and post-run hooks + args: + verbose-mode: + help: Run the all the tests in verbose mode + type: bool + action: store_true + env: + MAKIM_FILE: tests/smoke/.makim-hooks.yaml + backend: bash + run: | + export VERBOSE_FLAG='${{ "--verbose" if args.verbose_mode else "" }}' + makim $VERBOSE_FLAG --file $MAKIM_FILE --help + makim $VERBOSE_FLAG --file $MAKIM_FILE --version + makim $VERBOSE_FLAG --file $MAKIM_FILE build.compile + error: help: This group helps tests failure tasks tasks: diff --git a/docs/tutorials/introduction/index.ipynb b/docs/tutorials/introduction/index.ipynb index 966aeee..f06afd2 100644 --- a/docs/tutorials/introduction/index.ipynb +++ b/docs/tutorials/introduction/index.ipynb @@ -119,9 +119,10 @@ " type: bool\n", " action: store_true\n", " help: if not set, the clean dependency will not be triggered.\n", - " dependencies:\n", - " - task: clean.tmp\n", - " if: ${{ args.clean == true }}\n", + " hooks:\n", + " pre-run:\n", + " - task: clean.tmp\n", + " if: ${{ args.clean == true }}\n", " run: |\n", " echo \"Runnint unit tests...\"" ] @@ -388,12 +389,13 @@ "\n", " run-all:\n", " help: Run tests for all the other tasks\n", - " dependencies:\n", - " - task: node\n", - " - task: perl\n", - " - task: python\n", - " - task: r\n", - " - task: sh" + " hooks:\n", + " pre-run:\n", + " - task: node\n", + " - task: perl\n", + " - task: python\n", + " - task: r\n", + " - task: sh" ] }, { @@ -702,23 +704,24 @@ " args:\n", " i-am-sure:\n", " type: bool\n", - " dependencies:\n", - " - task: print.name\n", - " if: ${{ args.i_am_sure == true }}\n", - " args:\n", - " name: Mary\n", - " - task: print.name\n", - " if: ${{ args.i_am_sure == true }}\n", - " args:\n", - " name: John\n", - " - task: print.name\n", - " if: ${{ args.i_am_sure == true }}\n", - " args:\n", - " name: Ellen\n", - " - task: print.name\n", - " if: ${{ args.i_am_sure == true }}\n", - " args:\n", - " name: Marc" + " hokos:\n", + " pre-run:\n", + " - task: print.name\n", + " if: ${{ args.i_am_sure == true }}\n", + " args:\n", + " name: Mary\n", + " - task: print.name\n", + " if: ${{ args.i_am_sure == true }}\n", + " args:\n", + " name: John\n", + " - task: print.name\n", + " if: ${{ args.i_am_sure == true }}\n", + " args:\n", + " name: Ellen\n", + " - task: print.name\n", + " if: ${{ args.i_am_sure == true }}\n", + " args:\n", + " name: Marc" ] }, { diff --git a/docs/tutorials/makim-for-nox-users/.makim.yaml b/docs/tutorials/makim-for-nox-users/.makim.yaml index d7ca5e2..0aa702c 100644 --- a/docs/tutorials/makim-for-nox-users/.makim.yaml +++ b/docs/tutorials/makim-for-nox-users/.makim.yaml @@ -28,6 +28,7 @@ groups: all: help: Run nox tests - dependencies: - - task: nox.tests - - task: nox.lint + hooks: + pre-run: + - task: nox.tests + - task: nox.lint diff --git a/docs/tutorials/makim-for-nox-users/index.ipynb b/docs/tutorials/makim-for-nox-users/index.ipynb index bd87832..3404313 100644 --- a/docs/tutorials/makim-for-nox-users/index.ipynb +++ b/docs/tutorials/makim-for-nox-users/index.ipynb @@ -607,9 +607,10 @@ "\n", " all:\n", " help: Run nox tests\n", - " dependencies:\n", - " - task: nox.tests\n", - " - task: nox.lint" + " hooks:\n", + " pre-run:\n", + " - task: nox.tests\n", + " - task: nox.lint" ] }, { diff --git a/src/makim/core.py b/src/makim/core.py index b17ab59..2e32bc1 100644 --- a/src/makim/core.py +++ b/src/makim/core.py @@ -446,18 +446,17 @@ def _load_task_args(self): ) # run commands - - def _run_dependencies(self, args: dict): - if not self.task_data.get('dependencies'): + def _run_hooks(self, args: dict, hook_type: str): + if not self.task_data.get('hooks', {}).get(hook_type): return - makim_dep = deepcopy(self) - args_dep_original = { + makim_hook = deepcopy(self) + args_hook_original = { 'help': args.get('help', False), 'version': args.get('version', False), 'args': {}, } - makim_dep._change_group_data() + makim_hook._change_group_data() # clean double dash prefix in args original_args_clean = {} @@ -470,33 +469,33 @@ def _run_dependencies(self, args: dict): else arg_value ) - for dep_data in self.task_data['dependencies']: - env, variables = makim_dep._load_scoped_data('task') + for hook_data in self.task_data['hooks'][hook_type]: + env, variables = makim_hook._load_scoped_data('task') for k, v in env.items(): os.environ[k] = v - makim_dep.env_scoped = deepcopy(env) - args_dep = {} + makim_hook.env_scoped = deepcopy(env) + args_hook = {} # update the arguments - for arg_name, arg_value in dep_data.get('args', {}).items(): + for arg_name, arg_value in hook_data.get('args', {}).items(): unescaped_value = ( str(arg_value) if isinstance(arg_value, str) else str(arg_value) ) - args_dep[f'--{arg_name}'] = yaml.safe_load( + args_hook[f'--{arg_name}'] = yaml.safe_load( TEMPLATE.from_string(unescaped_value).render( - args=original_args_clean, env=makim_dep.env_scoped + args=original_args_clean, env=makim_hook.env_scoped ) ) - args_dep['task'] = dep_data['task'] - args_dep.update(args_dep_original) + args_hook['task'] = hook_data['task'] + args_hook.update(args_hook_original) # checking for the conditional statement - if_stmt = dep_data.get('if') + if_stmt = hook_data.get('if') if if_stmt: result = TEMPLATE.from_string(str(if_stmt)).render( args=original_args_clean, env=self.env_scoped @@ -504,12 +503,12 @@ def _run_dependencies(self, args: dict): if not yaml.safe_load(result): if self.verbose: MakimLogs.print_info( - '[II] Skipping dependency: ' - f'{dep_data.get("task")}' + f'[II] Skipping {hook_type} hook: ' + f'{hook_data.get("task")}' ) continue - makim_dep.run(deepcopy(args_dep)) + makim_hook.run(deepcopy(args_hook)) def _run_command(self, args: dict): cmd = self.task_data.get('run', '').strip() @@ -588,7 +587,7 @@ def _run_command(self, args: dict): os.environ.clear() os.environ.update(self.env_scoped) - # public methods + # public methods def load(self, file: str, dry_run: bool = False, verbose: bool = False): """Load makim configuration.""" @@ -618,5 +617,6 @@ def run(self, args: dict): 'Condition (if) not satisfied.' ) - self._run_dependencies(args) + self._run_hooks(args, 'pre-run') self._run_command(args) + self._run_hooks(args, 'post-run') diff --git a/tests/smoke/.makim-bash-group-scope.yaml b/tests/smoke/.makim-bash-group-scope.yaml index d31bdf6..91f6fa0 100644 --- a/tests/smoke/.makim-bash-group-scope.yaml +++ b/tests/smoke/.makim-bash-group-scope.yaml @@ -11,8 +11,9 @@ groups: type: bool action: store_true help: Remove all files that are tracked by git - dependencies: - - task: group-deps.dep + hooks: + pre-run: + - task: group-deps.dep run: | export MAKIM_TEST=$(pwd) echo ${MAKIM_TEST} diff --git a/tests/smoke/.makim-bash-task-scope.yaml b/tests/smoke/.makim-bash-task-scope.yaml index 9bca514..88198a3 100644 --- a/tests/smoke/.makim-bash-task-scope.yaml +++ b/tests/smoke/.makim-bash-task-scope.yaml @@ -12,8 +12,9 @@ groups: test: backend: bash help: Test bash defined in the task scope - dependencies: - - task: task-scope.dep + hooks: + pre-run: + - task: task-scope.dep run: | export MAKIM_TEST=$(pwd) echo ${MAKIM_TEST} diff --git a/tests/smoke/.makim-complex.yaml b/tests/smoke/.makim-complex.yaml index d3b99a2..f93f8b7 100644 --- a/tests/smoke/.makim-complex.yaml +++ b/tests/smoke/.makim-complex.yaml @@ -15,8 +15,9 @@ groups: clean: help: Remove all unnecessary temporary files - dependencies: - - task: build.clean-gcda + hooks: + pre-run: + - task: build.clean-gcda run: echo "[II] Remove unnecessary files" install: @@ -46,9 +47,10 @@ groups: help: Extra arguments for the build step type: string default: "" - dependencies: - - task: build.clean - if: ${{ args.clean }} + hooks: + pre-run: + - task: build.clean + if: ${{ args.clean }} run: | $ASAN_OPTIONS = '${{ args.asan_options }}' echo "[II] Build the package for release options:" @@ -62,13 +64,14 @@ groups: help: Clean temporary files before the building step type: bool action: store_true - dependencies: - - task: build.release - args: - build-type: "debug" - extra: "-Ddev=enabled -Db_coverage=true -Doptimization=0" - clean: ${{ args.clean }} - asan-options: "fast_unwind_on_malloc=0" + hooks: + pre-run: + - task: build.release + args: + build-type: "debug" + extra: "-Ddev=enabled -Db_coverage=true -Doptimization=0" + clean: ${{ args.clean }} + asan-options: "fast_unwind_on_malloc=0" env: tasks: @@ -102,9 +105,10 @@ groups: build: help: Build the general docs pages - dependencies: - - task: docs.clean - - task: docs.api + hooks: + pre-run: + - task: docs.clean + - task: docs.api run: echo "[II] Build general docs" clean: @@ -113,9 +117,10 @@ groups: preview: help: Preview documentation result locally - dependencies: - - task: docs.clean - - task: docs.api + hooks: + pre-run: + - task: docs.clean + - task: docs.api run: echo "[II] Preview documentation result locally" tests: @@ -142,16 +147,18 @@ groups: examples: help: Test all code generation for the example package files - dependencies: - - task: tests.gen-object - - task: tests.gen-ast - - task: tests.gen-llvm-ir + hooks: + pre-run: + - task: tests.gen-object + - task: tests.gen-ast + - task: tests.gen-llvm-ir all: help: Run sanitizer tests and code generation for examples - dependencies: - - task: tests.sanitizer - - task: tests.examples + hooks: + pre-run: + - task: tests.sanitizer + - task: tests.examples debug: tasks: diff --git a/tests/smoke/.makim-dir-absolute-path.yaml b/tests/smoke/.makim-dir-absolute-path.yaml index a9442e9..e994747 100644 --- a/tests/smoke/.makim-dir-absolute-path.yaml +++ b/tests/smoke/.makim-dir-absolute-path.yaml @@ -17,8 +17,9 @@ groups: tasks: task-no-path: help: Test global absolute path, group no path, task no path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os print(os.getcwd()) @@ -28,8 +29,9 @@ groups: task-absolute: dir: "/tmp" help: Test global absolute path, group no path, task absolute path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp" @@ -38,8 +40,9 @@ groups: task-relative: dir: "/tmp/group1/task4" help: est global absolute path, group no path, task relative path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp/group1/task4" @@ -50,8 +53,9 @@ groups: tasks: task-no-path: help: Test global absolute path, group relative path, task no path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp/group1" @@ -60,8 +64,9 @@ groups: task-absolute: dir: "/tmp" help: Test global absolute path, group relative path, task absolute path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp" @@ -70,8 +75,9 @@ groups: task-relative: dir: "task3" help: Test global absolute path, group relative path, task relative path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp/group1/task3" @@ -82,8 +88,9 @@ groups: tasks: task-no-path: help: Test global absolute path, group absolute path, task no path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp/group2" @@ -92,8 +99,9 @@ groups: task-absolute: dir: "/tmp" help: Test global absolute path, group absolute path, task absolute path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp" @@ -103,8 +111,9 @@ groups: dir: "task-relative" help: | Test global absolute path, group absolute path, task relative path - dependencies: - - task: setup.folders + hooks: + pre-run: + - task: setup.folders run: | import os assert os.getcwd() == "/tmp/group2/task-relative" diff --git a/tests/smoke/.makim-dir-no-path.yaml b/tests/smoke/.makim-dir-no-path.yaml index 353cc9c..bbd9b47 100644 --- a/tests/smoke/.makim-dir-no-path.yaml +++ b/tests/smoke/.makim-dir-no-path.yaml @@ -14,8 +14,9 @@ groups: tasks: task-no-path: help: Test global no-path, group no-path, task no-path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os echo f"{os.getcwd()}" @@ -24,8 +25,9 @@ groups: task-absolute: dir: "/tmp/task1" help: Test global no-path, group no-path, task absolute - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/task1" @@ -34,8 +36,9 @@ groups: task-relative: dir: "task2" help: Test global no-path, group no-path, task relative - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/task2" @@ -46,8 +49,9 @@ groups: tasks: task-no-path: help: Test global no-path, group absolute path, task no-path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/group-absolute" @@ -56,8 +60,9 @@ groups: task-absolute: dir: /tmp/task1 help: Test global no-path, group absolute path, task absolute path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/task1" @@ -66,8 +71,9 @@ groups: task-relative: dir: "task1" help: Test global no-path, group absolute path, task relative path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/group-absolute/task1" @@ -78,8 +84,9 @@ groups: tasks: task-no-path: help: Test global no-path, group relative path, task no-path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/group-relative" @@ -88,8 +95,9 @@ groups: task-absolute: dir: "/tmp/task2" help: Test global no-path, group relative path, task absolute path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/task2" @@ -98,8 +106,9 @@ groups: task-relative: dir: "task1" help: Test global no-path, group relative path, task relative path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/group-relative/task1" diff --git a/tests/smoke/.makim-dir-relative-path.yaml b/tests/smoke/.makim-dir-relative-path.yaml index 839c1a3..0cf304f 100644 --- a/tests/smoke/.makim-dir-relative-path.yaml +++ b/tests/smoke/.makim-dir-relative-path.yaml @@ -16,8 +16,9 @@ groups: tasks: task-no-path: help: Test global relative path, group no-path, task no-path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os print(os.getcwd()) @@ -27,8 +28,9 @@ groups: task-absolute: dir: "/tmp/global-relative/task1" help: Test global relative path, group no-path, task absolute path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/task1" @@ -37,8 +39,9 @@ groups: task-relative: dir: "task2" help: Test global relative path, group no-path, task relative path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/task2" @@ -49,8 +52,9 @@ groups: tasks: task-no-path: help: Test global relative path, group absolute path, task no-path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/group-absolute" @@ -60,8 +64,9 @@ groups: dir: "/tmp/global-relative/task2" help: | Test global relative path, group absolute path, task absolute path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/task2" @@ -71,8 +76,9 @@ groups: dir: "task1" help: | Test global relative path, group absolute path, task relative path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/group-absolute/task1" @@ -83,8 +89,9 @@ groups: tasks: task-no-path: help: Test global relative path, group relative path, task no-path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/group-relative" @@ -94,8 +101,9 @@ groups: dir: "/tmp/global-relative/task2" help: | Test global relative path, group absolute path, task absolute path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/task2" @@ -105,8 +113,9 @@ groups: dir: "task1" help: | Test global relative path, group absolute path, task relative path - dependencies: - - task: setup.create-folders + hooks: + pre-run: + - task: setup.create-folders run: | import os assert os.getcwd() == "/tmp/global-relative/group-relative/task1" diff --git a/tests/smoke/.makim-env.yaml b/tests/smoke/.makim-env.yaml index 1921536..ac33c18 100644 --- a/tests/smoke/.makim-env.yaml +++ b/tests/smoke/.makim-env.yaml @@ -78,10 +78,11 @@ groups: from-global: help: Test a rerender from the global scope env-file: .env - dependencies: - - task: rerender-env.dep - args: - my-value: "${{ env.GROUP_VAR_1 }}" + hooks: + pre-run: + - task: rerender-env.dep + args: + my-value: "${{ env.GROUP_VAR_1 }}" env: MYVAR_1: ${{ env.GLOBAL_VAR_1 }} MYVAR_2: ${{ env.GLOBAL_VAR_2 }} diff --git a/tests/smoke/.makim-hooks.yaml b/tests/smoke/.makim-hooks.yaml new file mode 100644 index 0000000..eebd1da --- /dev/null +++ b/tests/smoke/.makim-hooks.yaml @@ -0,0 +1,40 @@ +version: 1.0 + +groups: + setup: + tasks: + check_dependencies: + help: Check if all required dependencies are installed + run: | + echo "Checking dependencies..." + echo "All dependencies are installed." + + prepare_workspace: + help: Prepare the workspace for build + run: | + echo "Preparing workspace..." + echo "Workspace is ready." + + deploy: + help: Deploy the project + run: | + echo "Project is deployed." + + build: + tasks: + compile: + help: Compile the project + hooks: + pre-run: + - task: setup.check_dependencies + if: ${{ 1 == 1 }} + - task: setup.prepare_workspace + if: ${{ 1 == 2 }} + + post-run: + - task: setup.deploy + if: ${{ 1 == 1 }} + + run: | + echo "Compiling the project..." + echo "Project compiled successfully." diff --git a/tests/smoke/.makim-interpreters.yaml b/tests/smoke/.makim-interpreters.yaml index 2aa9b14..3d588a7 100644 --- a/tests/smoke/.makim-interpreters.yaml +++ b/tests/smoke/.makim-interpreters.yaml @@ -48,11 +48,12 @@ groups: run: echo "Hello, World!" all: - dependencies: - - task: main.node - - task: main.perl - # note: php from conda-forge has conflicts with r-base - # - task: main.php - - task: main.python - - task: main.r - - task: main.sh + hooks: + pre-run: + - task: main.node + - task: main.perl + # note: php from conda-forge has conflicts with r-base + # - task: main.php + - task: main.python + - task: main.r + - task: main.sh diff --git a/tests/smoke/.makim-simple.yaml b/tests/smoke/.makim-simple.yaml index cf27670..1cfed70 100644 --- a/tests/smoke/.makim-simple.yaml +++ b/tests/smoke/.makim-simple.yaml @@ -31,11 +31,12 @@ groups: help: if not set, the clean dependency will not be triggered. type: bool action: store_true - dependencies: - - task: default.clean - if: ${{ args.clean or args.clean_all }} - args: - all: ${{ args.clean_all }} + hooks: + pre-run: + - task: default.clean + if: ${{ args.clean or args.clean_all }} + args: + all: ${{ args.clean_all }} run: | echo "build file x" echo "build file y" diff --git a/tests/smoke/.makim-sugar.yaml b/tests/smoke/.makim-sugar.yaml index bfcc853..5de571f 100644 --- a/tests/smoke/.makim-sugar.yaml +++ b/tests/smoke/.makim-sugar.yaml @@ -12,8 +12,9 @@ groups: sugar ext restart --all --options -d run: help: test running a docker service using containers-sugar - dependencies: - - task: containers.setup + hooks: + pre-run: + - task: containers.setup backend: bash run: | sugar exec --service service1 --options -T --cmd python -c "print(1)" diff --git a/tests/smoke/.makim-unittest.yaml b/tests/smoke/.makim-unittest.yaml index 5eb376f..ce0147b 100644 --- a/tests/smoke/.makim-unittest.yaml +++ b/tests/smoke/.makim-unittest.yaml @@ -27,8 +27,9 @@ groups: test-3-b: help: test-3-b - dependencies: - - task: tests.test-3-a + hooks: + pre-run: + - task: tests.test-3-a run: assert True test-4-dep: @@ -47,11 +48,12 @@ groups: help: Help trigger-dep type: bool action: store_true - dependencies: - - task: tests.test-4-dep - if: ${{ args.trigger_dep }} - args: - arg1: ${{ args.trigger_dep }} + hooks: + pre-run: + - task: tests.test-4-dep + if: ${{ args.trigger_dep }} + args: + arg1: ${{ args.trigger_dep }} run: "true" test-5-dep: @@ -65,9 +67,10 @@ groups: help: Help trigger-dep type: bool action: store_true - dependencies: - - task: tests.test-5-dep - if: ${{ args.trigger_dep }} + hooks: + pre-run: + - task: tests.test-5-dep + if: ${{ args.trigger_dep }} run: assert True test-6-dep-1: @@ -89,13 +92,14 @@ groups: help: Help trigger-dep type: bool action: store_true - dependencies: - - task: tests.test-6-dep-1 - if: ${{ True }} - - task: tests.test-6-dep-2 - if: ${{ False }} - - task: tests.test-6-dep-3 - if: ${{ True }} + hooks: + pre-run: + - task: tests.test-6-dep-1 + if: ${{ True }} + - task: tests.test-6-dep-2 + if: ${{ False }} + - task: tests.test-6-dep-3 + if: ${{ True }} run: | cat /tmp/makim-test.txt | grep "OK" rm -f /tmp/makim-test.txt