From 588dd17b5c3d0c6a40a34e9e2459810c2cad9469 Mon Sep 17 00:00:00 2001 From: Andrew Hosgood Date: Thu, 21 Sep 2023 14:42:38 +0100 Subject: [PATCH] Fix workflow actions --- .github/actions/lint/action.yml | 2 ++ .github/actions/prototype-kit-test/action.yml | 9 +++++++++ .github/actions/tests/action.yml | 4 ++++ .github/workflows/publish-storybook.yml | 11 +++++++++++ 4 files changed, 26 insertions(+) diff --git a/.github/actions/lint/action.yml b/.github/actions/lint/action.yml index f820ea83..6b92aaf1 100644 --- a/.github/actions/lint/action.yml +++ b/.github/actions/lint/action.yml @@ -12,5 +12,7 @@ runs: node-version-file: .nvmrc - name: Install dependencies run: npm ci + shell: bash - name: Lint run: npm run lint + shell: bash diff --git a/.github/actions/prototype-kit-test/action.yml b/.github/actions/prototype-kit-test/action.yml index 15dd14c7..5e61dcb3 100644 --- a/.github/actions/prototype-kit-test/action.yml +++ b/.github/actions/prototype-kit-test/action.yml @@ -12,24 +12,30 @@ runs: node-version-file: .nvmrc - name: Install dependencies run: npm ci + shell: bash - name: Build package run: > ./tasks/build-package.sh && cd package && npm pack --pack-destination . + shell: bash - name: Test package run: node tasks/test-package.js || exit 1 + shell: bash - name: Create prototype run: > mkdir prototype && cd prototype && npx govuk-prototype-kit create + shell: bash - name: Create usage data config run: echo "{\"collectUsageData\":false}" > prototype/usage-data-config.json + shell: bash - name: Install package run: > cd prototype && npm install ../package/nationalarchives-frontend-$(node -p "require('../package.json').version").tgz + shell: bash - name: Add imports to template run: > echo -e "{% from \"nationalarchives/components/breadcrumbs/macro.njk\" import tnaBreadcrumbs %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && @@ -50,6 +56,7 @@ runs: echo -e "{% from \"nationalarchives/components/sensitive-image/macro.njk\" import tnaSensitiveImage %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/skip-link/macro.njk\" import tnaSkipLink %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && echo -e "{% from \"nationalarchives/components/tabs/macro.njk\" import tnaTabs %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html + shell: bash - name: Add components to template run: > echo "\n{% block bodyEnd %}" >> prototype/app/views/index.html && @@ -72,10 +79,12 @@ runs: echo "{{ tnaSkipLink({}) }}" >> prototype/app/views/index.html && echo "{{ tnaTabs({}) }}" >> prototype/app/views/index.html && echo "{% endblock %}" >> prototype/app/views/index.html + shell: bash - name: Run prototype run: > cd prototype && npm run dev & + shell: bash - uses: nev7n/wait_for_response@v1 with: url: "http://localhost:3000" diff --git a/.github/actions/tests/action.yml b/.github/actions/tests/action.yml index 7a2ed895..fc5752c1 100644 --- a/.github/actions/tests/action.yml +++ b/.github/actions/tests/action.yml @@ -12,9 +12,13 @@ runs: node-version-file: .nvmrc - name: Install dependencies run: npm ci + shell: bash - name: Build Storybook run: npm run build + shell: bash - name: Start Storybook run: npm start & + shell: bash - name: Run tests run: npm run test + shell: bash diff --git a/.github/workflows/publish-storybook.yml b/.github/workflows/publish-storybook.yml index 093dc3b2..09dc72f2 100644 --- a/.github/workflows/publish-storybook.yml +++ b/.github/workflows/publish-storybook.yml @@ -4,6 +4,17 @@ on: push: branches: - main + paths: + - '.storybook/**' + - 'src/**' + - '.babelrc.json' + - '.eslintrc.js' + - '.nvmrc' + - '.stylelintrc' + - 'govuk-prototype-kit.config.json' + - 'package-lock.json' + - 'package.json' + - 'webpack.config.js' permissions: contents: read