Fix pnpm install script for large PRs #41550
Workflow file for this run
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
name: CI | |
on: pull_request | |
permissions: | |
contents: read | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
if: github.repository == 'DefinitelyTyped/DefinitelyTyped' | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
# Need this to be able to inquire about origin/master | |
filter: blob:none # https://github.blog/2020-12-21-get-up-to-speed-with-partial-clone-and-shallow-clone/ | |
fetch-depth: 0 # Default is 1; need to set to 0 to get the benefits of blob:none. | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
# forbid symlinks | |
- name: 'Pre-run validation' | |
run: | | |
symlinks="$(find . -type l)" | |
if [[ -n "$symlinks" ]]; then | |
printf "Aborting: symlinks found:\n%s" "$symlinks"; exit 1 | |
fi | |
- uses: pnpm/action-setup@v2 | |
- name: Get pnpm cache info | |
id: pnpm-cache | |
run: | | |
echo "store=$(pnpm store path)" >> $GITHUB_OUTPUT | |
- name: Restore pnpm cache | |
uses: actions/cache/restore@v3 | |
with: | |
path: ${{ steps.pnpm-cache.outputs.store }} | |
key: ${{ runner.os }}-pnpm-store-cache- | |
restore-keys: ${{ runner.os }}-pnpm-store-cache- | |
- run: ./scripts/pnpm-install.sh | |
name: pnpm install | |
- run: pnpm ls | |
# Run tests | |
- run: pnpm run test-all | |
- name: 'Run Danger' | |
env: | |
# See https://github.com/danger/danger-js/issues/1042 | |
DANGER_GITHUB_API_BASE_URL: 'https://api.github.com' | |
# Danger failing (for example through rate-limiting) shouldn't fail the build | |
run: | | |
# Exposing this token is safe because the user of it has no other public repositories | |
# and has no permission to modify this repository. See #62638 for the discussion. | |
TOKEN='ghp_i5wtj1l2AbpFv3OU96w6R' | |
TOKEN+='On3bHOkcV2AmVY6' | |
DANGER_GITHUB_API_TOKEN=$TOKEN pnpm danger ci || $( exit 0 ) | |
scripts: | |
runs-on: ubuntu-latest | |
if: github.repository == 'DefinitelyTyped/DefinitelyTyped' | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '16' | |
- uses: pnpm/action-setup@v2 | |
with: | |
run_install: | | |
- args: [--filter, ., --filter, '{./scripts}...'] | |
- run: pnpm tsc -p ./scripts |