Skip to content

test: fix type errors #9997

test: fix type errors

test: fix type errors #9997

on:
push:
branches:
- master
- 'cherry-pick/**'
pull_request:
merge_group:
name: 'Integration'
jobs:
chore:
name: 'Testing chores'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
git fetch --no-tags --unshallow origin HEAD master
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: 'Check that the Yarn files don''t change on new installs (fix w/ "yarn install")'
run: |
node ./scripts/run-yarn.js --immutable --immutable-cache
shell: bash
env:
YARN_ENABLE_NETWORK: 0
- name: 'Check that the cache files are consistent with their remote sources'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- .yarn/cache | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js --immutable --immutable-cache --check-cache
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the patch files are consistent with fresh builds'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/plugin-compat/sources/patches | wc -l) -gt 0 ]]; then
for generator in packages/plugin-compat/extra/*/gen-*-patch.sh; do
bash $generator;
done
for generator in packages/plugin-compat/extra/*/gen-*-patch.js; do
yarn node $generator;
done
[[ $(git diff --name-only packages/plugin-compat/sources/patches "packages/plugin-compat/extra/typescript/patch*" | tee /dev/stderr | wc -l) -eq 0 ]]
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the PnP hooks are consistent with a fresh build (fix w/ "git merge master && yarn update:pnp:hook")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/yarnpkg-{fslib,libzip,pnp}/sources/**/*' | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:pnp:hook
[[ $(git diff --name-only packages/yarnpkg-pnp/sources/{hook.js,esm-loader/built-loader.js} | wc -l) -eq 0 ]]
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the Zip worker is consistent with a fresh build (fix w/ "git merge master && yarn update:zip:worker")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/yarnpkg-{fslib,libzip,core}/sources/**/*' | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:zip:worker
[[ $(git diff --name-only packages/yarnpkg-core/sources/worker-zip/index.js | wc -l) -eq 0 ]]
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the pluginCommands file is consistent with a fresh build (fix w/ "yarn build:plugin-commands")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- packages/yarnpkg-cli/sources/pluginCommands.ts 'packages/*/sources/commands/**/*' | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js build:plugin-commands
[[ $(git diff --name-only packages/yarnpkg-cli/sources/pluginCommands.ts | tee /dev/stderr | wc -l) -eq 0 ]]
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the grammars are consistent with fresh builds (fix w/ "yarn grammar:all")'
run: |
if [[ $(git diff --name-only "$(git merge-base origin/"$TARGET_BRANCH" HEAD)" HEAD -- 'packages/yarnpkg-parsers/sources/grammars/*.{pegjs,js}' | wc -l) -gt 0 ]]; then
node ./scripts/run-yarn.js grammar:all
[[ $(git diff --name-only packages/yarnpkg-parsers/sources/grammars/*.js | tee /dev/stderr | wc -l) -eq 0 ]]
fi
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
env:
TARGET_BRANCH: ${{github.event.pull_request.base.ref}}
- name: 'Check that the PR describes which packages should be bumped (fix w/ "yarn version check -i")'
run: |
node ./scripts/run-yarn.js version check
shell: bash
if: |
(success() || failure()) && github.event.pull_request != ''
- name: 'Check for linting errors (fix w/ "yarn test:lint --fix")'
run: |
node ./scripts/run-yarn.js test:lint
shell: bash
if: |
success() || failure()
- name: 'Check for unmet constraints (fix w/ "yarn constraints --fix")'
run: |
node ./scripts/run-yarn.js constraints
shell: bash
if: |
success() || failure()
- name: 'Check for type errors'
run: |
node ./scripts/run-yarn.js typecheck:all
shell: bash
if: |
success() || failure()
- name: 'Check for duplicate dependencies (fix w/ "yarn dedupe")'
run: |
node ./scripts/run-yarn.js dedupe --check
shell: bash
if: |
success() || failure()
build:
name: 'Build artifacts'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18.x
- name: 'Build bundle & plugins'
run: |
node --version
node ./scripts/run-yarn.js build:pnp:hook
node ./scripts/run-yarn.js build:zip:worker
node ./scripts/run-yarn.js build:cli
mv ./packages/yarnpkg-cli/bundles/yarn.js ./packages/yarnpkg-cli/bundles/yarn-min.js
node ./scripts/run-yarn.js build:cli --no-minify
node ./scripts/run-yarn.js build:plugin-constraints
node ./scripts/run-yarn.js build:plugin-exec
node ./scripts/run-yarn.js build:plugin-interactive-tools
node ./scripts/run-yarn.js build:plugin-stage
node ./scripts/run-yarn.js build:plugin-typescript
node ./scripts/run-yarn.js build:plugin-version
node ./scripts/run-yarn.js build:plugin-workspace-tools
shell: bash
- uses: actions/upload-artifact@v3
with:
name: yarn-artifacts
path: |
./packages/*/bundles
./packages/yarnpkg-pnp/sources/hook.js
./packages/yarnpkg-core/sources/worker-zip/index.js
- name: 'Build vscode-zipfs'
run: |
node ./scripts/run-yarn.js package:vscode-zipfs
if: |
success() || failure()
- uses: actions/upload-artifact@v3
with:
name: vscode-zipfs
path: ./packages/vscode-zipfs/vscode-zipfs-*.vsix
acceptance:
strategy:
fail-fast: false
matrix:
node:
- 12
- 14
- 16
- 17
platform:
- ubuntu-latest
- windows-latest
- macos-latest
name: '${{matrix.platform}} w/ Node.js ${{matrix.node}}.x'
runs-on: ${{matrix.platform}}
needs: build
steps:
- uses: actions/checkout@v3
- name: 'Use Node.js ${{matrix.node}}.x'
uses: actions/setup-node@v3
with:
node-version: ${{matrix.node}}.x
- uses: actions/download-artifact@v3
with:
name: yarn-artifacts
path: packages
- name: 'Run the integration tests'
run: |
node ./scripts/run-yarn.js test:integration --maxWorkers=100%
shell: bash
- name: 'Run the unit tests'
run: |
node ./scripts/run-yarn.js test:unit --maxWorkers=100%
shell: bash
if: |
success() || failure()