ci: bump peter-evans/create-pull-request from 6 to 7 #32
This file contains hidden or 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
name: CI | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
env: | |
NODE_VERSION: '20' | |
PNPM_VERSION: '9' | |
jobs: | |
setup: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
outputs: | |
pnpm-cache-dir: ${{ steps.pnpm-cache.outputs.pnpm-cache-dir }} | |
node-modules-cache-hit: ${{ steps.node-modules-cache.outputs.cache-hit }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Get pnpm store directory | |
id: pnpm-cache | |
shell: bash | |
run: | | |
echo "pnpm-cache-dir=$(pnpm store path --silent)" >> $GITHUB_OUTPUT | |
- name: Setup pnpm cache | |
uses: actions/cache@v4 | |
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: Cache node_modules | |
id: node-modules-cache | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
if: steps.node-modules-cache.outputs.cache-hit != 'true' | |
run: pnpm install --frozen-lockfile | |
lint: | |
runs-on: ubuntu-latest | |
timeout-minutes: 10 | |
needs: setup | |
strategy: | |
matrix: | |
lint-type: [js, css, types] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Setup pnpm cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.setup.outputs.pnpm-cache-dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
if: needs.setup.outputs.node-modules-cache-hit != 'true' | |
run: pnpm install --frozen-lockfile | |
- name: Run JS/TS lint | |
if: matrix.lint-type == 'js' | |
run: pnpm lint | |
- name: Run CSS lint | |
if: matrix.lint-type == 'css' | |
run: pnpm lint:css | |
- name: Run type check | |
if: matrix.lint-type == 'types' | |
run: pnpm type-check | |
build: | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
needs: setup | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install pnpm | |
uses: pnpm/action-setup@v4 | |
with: | |
version: ${{ env.PNPM_VERSION }} | |
- name: Setup pnpm cache | |
uses: actions/cache@v4 | |
with: | |
path: ${{ needs.setup.outputs.pnpm-cache-dir }} | |
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm-store- | |
- name: Cache node_modules | |
uses: actions/cache@v4 | |
with: | |
path: node_modules | |
key: ${{ runner.os }}-node-modules-${{ hashFiles('**/pnpm-lock.yaml') }} | |
- name: Install dependencies | |
if: needs.setup.outputs.node-modules-cache-hit != 'true' | |
run: pnpm install --frozen-lockfile | |
- name: Run build | |
run: pnpm build | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: build-files | |
path: dist/ | |
retention-days: 7 |