Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure Node.js version is always explicitly set in CI #208

Merged
merged 3 commits into from
Mar 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: 'Set up Node.js'
description: 'Install Node.js and development dependencies'

inputs:
node-version:
description: 'Node.js version to install'
default: '18'

runs:
using: 'composite'
steps:
- name: 'Install Node.js'
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: npm

- name: 'Install development dependencies'
run: npm ci --audit=false
shell: bash
12 changes: 8 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,19 @@ jobs:
with:
persist-credentials: false

- name: Install and Build 🔧
- name: Install 🔧
uses: ./.github/actions/setup

- name: Build 🏗️
run: |
npm ci --audit=false
npm run build-storybook
npm run build
touch ./prime/.nojekyll

# TODO(mc, 2023-03-22): replace with GitHub-official action
# https://github.com/actions/deploy-pages
- name: Deploy Storybook 🚀
uses: JamesIves/github-pages-deploy-action@v4
uses: JamesIves/github-pages-deploy-action@ba1486788b0490a235422264426c45848eac35c6
with:
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: prime # The folder that the build-storybook script generates files.
Expand All @@ -32,6 +36,6 @@ jobs:
.nojekyll

- name: Publish 🚀
uses: JS-DevTools/npm-publish@v1
uses: JS-DevTools/npm-publish@0f451a94170d1699fd50710966d48fb26194d939
with:
token: ${{ secrets.NPM_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install 🔧
run: npm ci --audit=false
uses: ./.github/actions/setup
- name: Run ESLint and Prettier
run: |
npm run lint
Expand All @@ -22,7 +22,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Install 🔧
run: npm ci --audit=false
uses: ./.github/actions/setup
- name: Run Check
run: npm run check

Expand All @@ -31,12 +31,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
- name: Install 🔧
uses: ./.github/actions/setup
with:
node-version: 16
- name: Install deps
- name: Install playground deps
run: |
npm ci --audit=false
cd playground
npm ci --audit=false
- name: Install Playwright Browsers
Expand Down