Skip to content

Commit

Permalink
Split out build test action
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Sep 21, 2023
1 parent 3e5db78 commit ef049ad
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 9 deletions.
21 changes: 21 additions & 0 deletions .github/actions/test-build-package/action.yml
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
8 changes: 1 addition & 7 deletions .github/actions/test-build/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Test build
name: Test build Storybook

on:
workflow_call:
Expand All @@ -16,9 +16,3 @@ runs:
- name: Build Storybook
run: npm run build
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
12 changes: 11 additions & 1 deletion .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,23 @@ jobs:
- check
steps:
- uses: actions/checkout@v3
- name: Test build
- name: Test build Storybook
uses: ./.github/actions/test-build

test-build-package:
runs-on: ubuntu-latest
needs:
- check
steps:
- uses: actions/checkout@v3
- name: Test build package
uses: ./.github/actions/test-build-package

prototype-kit:
runs-on: ubuntu-latest
needs:
- test-build
- test-build-package
steps:
- uses: actions/checkout@v3
- name: GOV.UK prototype kit test
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,21 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Tests
- name: Test build Storybook
uses: ./.github/actions/test-build

test-build-package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Test build package
uses: ./.github/actions/test-build-package

prototype-kit:
runs-on: ubuntu-latest
needs:
- test-build
- test-build-package
steps:
- uses: actions/checkout@v3
- name: GOV.UK prototype kit test
Expand Down

0 comments on commit ef049ad

Please sign in to comment.