Skip to content

Commit

Permalink
Fix workflow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Sep 21, 2023
1 parent 7ee5470 commit 588dd17
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/actions/lint/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
9 changes: 9 additions & 0 deletions .github/actions/prototype-kit-test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand All @@ -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 &&
Expand All @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions .github/actions/tests/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
11 changes: 11 additions & 0 deletions .github/workflows/publish-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 588dd17

Please sign in to comment.