Skip to content

Commit

Permalink
Tweak workflow actions
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Sep 21, 2023
1 parent 588dd17 commit 3e5db78
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 14 deletions.
5 changes: 1 addition & 4 deletions .github/actions/prototype-kit-test/action.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: GOV.UK prototype kit
name: GOV.UK prototype kit test

on:
workflow_call:
Expand All @@ -19,9 +19,6 @@ runs:
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 &&
Expand Down
24 changes: 24 additions & 0 deletions .github/actions/test-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Test build

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: Build package
run: ./tasks/build-package.sh
shell: bash
- name: Test built package
run: node tasks/test-package.js || exit 1
shell: bash
20 changes: 16 additions & 4 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,23 +24,35 @@ jobs:
- check
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/lint
- name: Lint
uses: ./.github/actions/lint

tests:
runs-on: ubuntu-latest
needs:
- check
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/tests
- name: Tests
uses: ./.github/actions/tests

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

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

publish-npm:
name: Build package and publish to npm
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,28 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/lint

- name: Lint
uses: ./.github/actions/lint

tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/tests
- name: Tests
uses: ./.github/actions/tests

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

prototype-kit:
runs-on: ubuntu-latest
needs:
- lint
- tests
- test-build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/prototype-kit-test
- name: GOV.UK prototype kit test
uses: ./.github/actions/prototype-kit-test

0 comments on commit 3e5db78

Please sign in to comment.