From f2b2b0382fd768cafbdc5f961a76ce0de240317c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kasper=20Garn=C3=A6s?= Date: Tue, 5 Dec 2023 18:00:49 +0100 Subject: [PATCH] Add support for resetting an environment This will reset the state of an environment. This is useful when switching between tasks, branches etc. Add usage of this to the test. --- .github/workflows/test.yml | 2 ++ Taskfile.yml | 22 ++++++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e6d4137..25aa211 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,6 +72,8 @@ jobs: # a difference. Reverse this using !. run: | ! diff ${{ runner.temp }}/design-system/base.before.css ${{ runner.temp }}/design-system/base.after.css + - name;: Reset environment + run: "task reset ${{ env.TASK_OUTPUT }}" - name: Setup tmate session to support debugging if enabled if: runner.debug == '1' uses: mxschmitt/action-tmate@v3 diff --git a/Taskfile.yml b/Taskfile.yml index ae46576..e9983f7 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -26,6 +26,13 @@ tasks: - task: cleanup - task: init + reset: + summary: Reset environment. This is useful when switching between tasks, branches etc. + deps: + - design-system:reset + - react:reset + - cms:reset + design-system:init: sources: - design-system/yarn.lock @@ -65,6 +72,11 @@ tasks: cmds: - yarn dev + design-system:reset: + dir: design-system + cmds: + - yarn install + react:init: sources: - react/yarn.lock @@ -103,6 +115,11 @@ tasks: cmds: - yarn dev + react:reset: + dir: react + cmds: + - yarn install + cms:init: sources: - cms/composer.lock @@ -130,6 +147,11 @@ tasks: cmds: - task dev:start + cms:reset: + dir: cms + cmds: + - task dev:reset + dev:react: deps: - design-system:build