Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for resetting an environment #4

Merged
merged 2 commits into from
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
51 changes: 30 additions & 21 deletions Taskfile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ tasks:
init:
summary: Setup this directory for development
deps:
- design-system:init
- react:init
- cms:init
- design-system:clone
- react:clone
- cms:clone
cmds:
- task: reset

cleanup:
cmds:
Expand All @@ -26,14 +28,16 @@ tasks:
- task: cleanup
- task: init

design-system:init:
sources:
- design-system/yarn.lock
generates:
- design-system/node_modules/*
reset:
summary: Reset environment. This is useful when switching between tasks, branches etc.
deps:
- design-system:reset
- react:reset
- cms:reset

design-system:clone:
cmds:
- git clone https://github.com/danskernesdigitalebibliotek/dpl-design-system design-system
- (cd design-system && yarn install)

design-system:link:
deps:
Expand Down Expand Up @@ -65,14 +69,14 @@ tasks:
cmds:
- yarn dev

react:init:
sources:
- react/yarn.lock
generates:
- react/node_modules/*
design-system:reset:
dir: design-system
cmds:
- yarn install

react:clone:
cmds:
- git clone https://github.com/danskernesdigitalebibliotek/dpl-react react
- (cd react && yarn install)

react:link:
dir: react
Expand Down Expand Up @@ -103,14 +107,14 @@ tasks:
cmds:
- yarn dev

cms:init:
sources:
- cms/composer.lock
generates:
- cms/vendor/*
react:reset:
dir: react
cmds:
- yarn install

cms:clone:
cmds:
- git clone https://github.com/danskernesdigitalebibliotek/dpl-cms cms
- (cd cms && task dev:reset)

cms:link:
dir: cms
Expand All @@ -130,6 +134,11 @@ tasks:
cmds:
- task dev:start

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

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