From 2c1b4290ddcd84a5b2fe7ab958c1d682219dcaa1 Mon Sep 17 00:00:00 2001 From: Charlie Brown Date: Wed, 18 Oct 2023 15:54:32 -0500 Subject: [PATCH] Upgrade CI to Node 18 and deprecate Node 14 --- .github/workflows/actions/setup/action.yml | 38 ++++++++++++++++++++++ .github/workflows/chromatic.yml | 36 ++------------------ .github/workflows/ci.yml | 30 ++--------------- .github/workflows/release.yml | 32 ++---------------- 4 files changed, 46 insertions(+), 90 deletions(-) create mode 100644 .github/workflows/actions/setup/action.yml diff --git a/.github/workflows/actions/setup/action.yml b/.github/workflows/actions/setup/action.yml new file mode 100644 index 000000000..5290e6348 --- /dev/null +++ b/.github/workflows/actions/setup/action.yml @@ -0,0 +1,38 @@ +name: Setup +description: Setup Build Step +inputs: + node-version: + required: true + default: '18.x' + +runs: + using: "composite" + steps: + - name: Use Node.js + uses: actions/setup-node@v3 + with: + node-version: ${{ inputs.node-version }} + + - uses: pnpm/action-setup@v2.2.2 + with: + version: 7 + + - name: Get pnpm store directory + id: pnpm-cache + shell: bash + 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- + + # Wireit cache + - uses: google/wireit@setup-github-actions-caching/v1 + + - name: Install dependencies + shell: bash + run: pnpm install diff --git a/.github/workflows/chromatic.yml b/.github/workflows/chromatic.yml index 6d6cc2511..6ee9fc1a1 100644 --- a/.github/workflows/chromatic.yml +++ b/.github/workflows/chromatic.yml @@ -16,40 +16,8 @@ jobs: if: github.event.pull_request.draft == false && github.repository == 'FormidableLabs/victory' runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - - name: Use Node.js - uses: actions/setup-node@v1 - 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/action-setup@v2.2.2 - 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: actions/checkout@v4 + - uses: ./.github/actions/setup - name: Build Storybook run: pnpm run storybook:build diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef7e72017..97d3e0e78 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,37 +19,13 @@ jobs: DISPLAY: :99.0 strategy: matrix: - node-version: [14.x, 16.x, 18.x] + node-version: [16.x, 18.x, 20.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/action-setup@v2.2.2 - 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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e1ca45d84..ac54595b0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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/action-setup@v2.2.2 - 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