diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4af8cd4..499919d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -27,6 +27,8 @@ jobs: repo-token: ${{ secrets.GITHUB_TOKEN }} - name: Initialize environment run: "task init ${{ env.TASK_OUTPUT }}" + - name: Prepare CMS for development + run: "task cms:dev ${{ env.TASK_OUTPUT }}" - name: Link Design system to React components run: "task react:link ${{ env.TASK_OUTPUT }}" - name: Link Design system and React components to CMS diff --git a/Taskfile.yml b/Taskfile.yml index 0753fe3..ccbf7b1 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -15,7 +15,7 @@ tasks: - react:clone - cms:clone cmds: - - task: reset + - task: install cleanup: cmds: @@ -29,17 +29,27 @@ tasks: - task: cleanup - task: init - reset: - summary: Reset environment. This is useful when switching between tasks, branches etc. + install: + summary: (Re)install all dependencies. deps: - - design-system:reset - - react:reset - - cms:reset + - design-system:install + - react:install + - cms:install design-system:clone: cmds: - git clone https://github.com/danskernesdigitalebibliotek/dpl-design-system design-system + design-system:install: + dir: design-system + sources: + - package.json + - yarn.lock + generates: + - node_modules/* + cmds: + - yarn install + design-system:link: deps: - design-system:build @@ -70,11 +80,6 @@ tasks: cmds: - yarn dev - design-system:reset: - dir: design-system - cmds: - - yarn install - react:clone: cmds: - git clone https://github.com/danskernesdigitalebibliotek/dpl-react react @@ -82,6 +87,16 @@ tasks: - cp react/.env.example react/.env - echo "COMPOSE_PROJECT_NAME={{.REACT_COMPOSE_PROJECT_NAME}}" >> react/.env + react:install: + dir: react + sources: + - package.json + - yarn.lock + generates: + - node_modules/* + cmds: + - yarn install + react:link: dir: react deps: @@ -116,17 +131,21 @@ tasks: cmds: - yarn dev - react:reset: - dir: react - cmds: - - yarn install - cms:clone: cmds: - git clone https://github.com/danskernesdigitalebibliotek/dpl-cms cms # Set project name to avoid conflicts with single checkouts. - sed "s|COMPOSE_PROJECT_NAME=dpl-cms|COMPOSE_PROJECT_NAME={{.CMS_COMPOSE_PROJECT_NAME}}|g" cms/.env + cms:install: + dir: cms + sources: + - composer.lock + generates: + - vendor/* + cmds: + - task dev:cli -- composer install + cms:link: dir: cms deps: @@ -140,13 +159,7 @@ tasks: cms:dev: dir: cms - deps: - - cms:link - cmds: - - task dev:start - - cms:reset: - dir: cms + run: once cmds: - task dev:reset @@ -157,8 +170,9 @@ tasks: - task: react:dev dev:cms: - deps: + cmds: - task: cms:dev + - task: cms:link dev:cms-react: deps: @@ -168,3 +182,4 @@ tasks: # run it on port 80 by default. To allow the user to reply we have to run # it as a separate task instead of a dependency. - task: react:dev + - task: cms:link \ No newline at end of file