Skip to content

Commit

Permalink
Upgrade CI to Node 18 and deprecate Node 14 (#2667)
Browse files Browse the repository at this point in the history
  • Loading branch information
carbonrobot authored Oct 19, 2023
1 parent c8381aa commit d6b125a
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 86 deletions.
26 changes: 26 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Setup
description: Setup Build Step
inputs:
node-version:
required: true
default: '18.x'

runs:
using: "composite"
steps:
- uses: pnpm/action-setup@v2
with:
version: 7

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1

- name: Install dependencies
shell: bash
run: pnpm install
33 changes: 4 additions & 29 deletions .github/workflows/chromatic.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,16 @@ jobs:
if: github.event.pull_request.draft == false && github.repository == 'FormidableLabs/victory'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
# requires all branches and tags to be fetched for chromatic
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Use Node.js
uses: actions/setup-node@v1
# requires node16, see https://github.com/FormidableLabs/victory/issues/2668
- uses: ./.github/actions/setup
with:
# TODO: Upgrade Node version.
# Node18 currently hits `Error: error:0308010C:digital envelope routines::unsupported`
# https://github.com/storybookjs/storybook/issues/16555
# When we upgrade to webpack5 this should go away.
node-version: 16.x

# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1

- uses: pnpm/[email protected]
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build Storybook
run: pnpm run storybook:build

Expand Down
30 changes: 3 additions & 27 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,37 +19,13 @@ jobs:
DISPLAY: :99.0
strategy:
matrix:
node-version: [14.x, 16.x, 18.x]
node-version: [16.x, 18.x]
steps:
- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node-version }}

# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1

- uses: pnpm/[email protected]
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Check all package.json's and tsconfig.json's are in sync.
run: |
pnpm sync
Expand Down
32 changes: 3 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,11 @@ jobs:
pull-requests: write

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CHANGESETS_GITHUB_TOKEN }}
+ token: ${{ secrets.CUSTOM_GITHUB_TOKEN }}

- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: 18.x

# Wireit cache
- uses: google/wireit@setup-github-actions-caching/v1

- uses: pnpm/[email protected]
with:
version: 7

- name: Get pnpm store directory
id: pnpm-cache
run: echo "::set-output name=pnpm_cache_dir::$(pnpm store path)"

- name: Setup pnpm cache
uses: actions/cache@v3
with:
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- uses: ./.github/actions/setup

- name: Build packages
run: pnpm run build
Expand Down
2 changes: 1 addition & 1 deletion packages/victory-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@
Please visit our documentation site to read more about these components
https://formidable.com/open-source/victory

To suggest an addition or correction to this documentation please see https://github.com/FormidableLabs/victory/blob/main/docs/src/content/docs
To suggest an addition or correction to this documentation please see https://github.com/FormidableLabs/victory/blob/main/docs/src/content/docs

1 comment on commit d6b125a

@vercel
Copy link

@vercel vercel bot commented on d6b125a Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.