-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:nationalarchives/tna-frontend into …
…feature/hero-cards
- Loading branch information
Showing
68 changed files
with
1,508 additions
and
492 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Lint | ||
|
||
on: | ||
workflow_call: | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
- name: Install dependencies | ||
run: npm ci | ||
shell: bash | ||
- name: Lint | ||
run: npm run lint | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
name: GOV.UK prototype kit test | ||
|
||
on: | ||
workflow_call: | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
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: 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 && | ||
echo -e "{% from \"nationalarchives/components/button/macro.njk\" import tnaButton %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/card/macro.njk\" import tnaCard %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/cookie-banner/macro.njk\" import tnaCookieBanner %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/filters/macro.njk\" import tnaFilters %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/footer/macro.njk\" import tnaFooter %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/gallery/macro.njk\" import tnaGallery %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/grid/macro.njk\" import tnaGrid %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/header/macro.njk\" import tnaHeader %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/hero/macro.njk\" import tnaHero %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/index-grid/macro.njk\" import tnaIndexGrid %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/message/macro.njk\" import tnaMessage %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/pagination/macro.njk\" import tnaPagination %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/phase-banner/macro.njk\" import tnaPhaseBanner %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/picture/macro.njk\" import tnaPicture %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
echo -e "{% from \"nationalarchives/components/profile/macro.njk\" import tnaProfile %}\n$(cat prototype/app/views/index.html)" > prototype/app/views/index.html && | ||
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 && | ||
echo "{{ tnaBreadcrumbs({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaButton({text:\"I am a button\",url:\"#\"}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaCard({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaCookieBanner({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaFilters({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaFooter({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaGallery({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaGrid({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaHeader({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaHero({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaIndexGrid({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaMessage({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaPagination({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaPhaseBanner({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaPicture({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaProfile({}) }}" >> prototype/app/views/index.html && | ||
echo "{{ tnaSensitiveImage({}) }}" >> prototype/app/views/index.html && | ||
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" | ||
responseCode: 200 | ||
timeout: 30000 | ||
interval: 500 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Test build package | ||
|
||
on: | ||
workflow_call: | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
- name: Install dependencies | ||
run: npm ci | ||
shell: bash | ||
- name: Build package | ||
run: ./tasks/build-package.sh | ||
shell: bash | ||
- name: Test built package | ||
run: node tasks/test-package.js || exit 1 | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Test build Storybook | ||
|
||
on: | ||
workflow_call: | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version-file: .nvmrc | ||
- name: Install dependencies | ||
run: npm ci | ||
shell: bash | ||
- name: Build Storybook | ||
run: npm run build | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Tests | ||
|
||
on: | ||
workflow_call: | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.