Fix pnpm install for all jobs #12
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Licensed to the Apache Software Foundation (ASF) under one or more | ||
# contributor license agreements. See the NOTICE file distributed with | ||
# this work for additional information regarding copyright ownership. | ||
# The ASF licenses this file to You under the Apache License, Version 2.0 | ||
# (the "License"); you may not use this file except in compliance with | ||
# the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
name: static | ||
on: | ||
pull_request: | ||
types: | ||
- opened | ||
- synchronize | ||
push: | ||
concurrency: | ||
group: static-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: ${{ github.event_name == 'pull_request' }} | ||
env: | ||
node_version: 20 | ||
pnpm_version: 8 | ||
work_dir: .github/scripts | ||
# TODO cache pnpm dev deps between jobs. cache key in pnpm action may not be doing anything. | ||
jobs: | ||
spelling: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Use pnpm ${{ env.pnpm_version }} | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.pnpm_version }} | ||
- name: Use Node.js ${{ env.node_version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node_version }} | ||
cache: 'pnpm' | ||
- name: Install pnpm dependencies | ||
run: pnpm install --dev | ||
- name: Run Spell Check | ||
working-directory: ${{ env.work_dir }} | ||
run: | | ||
markdownlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Use pnpm ${{ env.pnpm_version }} | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.pnpm_version }} | ||
- name: Use Node.js ${{ env.node_version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node_version }} | ||
cache: 'pnpm' | ||
- name: Install pnpm dependencies | ||
run: pnpm install --dev | ||
- name: Run markdownlint | ||
working-directory: ${{ env.work_dir }} | ||
run: | | ||
markdownlint.sh | ||
frontmatter: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Use pnpm ${{ env.pnpm_version }} | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.pnpm_version }} | ||
- name: Use Node.js ${{ env.node_version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node_version }} | ||
cache: 'pnpm' | ||
- name: Install pnpm dependencies | ||
run: pnpm install --dev | ||
- name: Run markdown frontmatter check | ||
working-directory: ${{ env.work_dir }} | ||
run: | | ||
frontmatter.sh | ||
sidebar: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Use pnpm ${{ env.pnpm_version }} | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: ${{ env.pnpm_version }} | ||
- name: Use Node.js ${{ env.node_version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ env.node_version }} | ||
cache: 'pnpm' | ||
- name: Install pnpm dependencies | ||
run: pnpm install --dev | ||
- name: Run docs sidebar check | ||
working-directory: ${{ env.work_dir }} | ||
run: | | ||
sidebar.sh | ||
file-names: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout project | ||
uses: actions/checkout@v4 | ||
- name: Run file name check | ||
working-directory: ${{ env.work_dir }} | ||
run: | | ||
./names.sh |