Skip to content

Commit

Permalink
Add support for resetting an environment
Browse files Browse the repository at this point in the history
This will reset the state of an environment. This is useful when
switching between tasks, branches etc.

Add usage of this to the test.
  • Loading branch information
kasperg committed Dec 5, 2023
1 parent 17a92c2 commit f2b2b03
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
22 changes: 22 additions & 0 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -65,6 +72,11 @@ tasks:
cmds:
- yarn dev

design-system:reset:
dir: design-system
cmds:
- yarn install

react:init:
sources:
- react/yarn.lock
Expand Down Expand Up @@ -103,6 +115,11 @@ tasks:
cmds:
- yarn dev

react:reset:
dir: react
cmds:
- yarn install

cms:init:
sources:
- cms/composer.lock
Expand Down Expand Up @@ -130,6 +147,11 @@ tasks:
cmds:
- task dev:start

cms:reset:
dir: cms
cmds:
- task dev:reset

dev:react:
deps:
- design-system:build
Expand Down

0 comments on commit f2b2b03

Please sign in to comment.