Slow imports rule check #1260
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
# This workflow checks that our slow-imports rule works correctly. | |
# This is done by intentionally breaking the rule, running the linter, and checking | |
# that we got a non-zero exit code. It's not a completely fault-proof strategy, | |
# but it's an useful smoke test. | |
name: Slow imports rule check | |
on: | |
schedule: | |
- cron: "0 0 * * *" | |
workflow_dispatch: | |
push: | |
paths: | |
- ".github/workflows/test-slow-imports-rule.yml" | |
defaults: | |
run: | |
working-directory: packages/hardhat-core | |
jobs: | |
test-slow-imports-rule: | |
name: Check that the slow-imports rule works correctly | |
runs-on: "ubuntu-latest" | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: ./.github/actions/setup-env | |
- name: Install | |
run: pnpm install --frozen-lockfile --prefer-offline | |
- name: Add slow import | |
run: echo 'import "lodash";' >> src/internal/core/config/config-resolution.ts | |
- name: Build | |
run: pnpm build | |
- name: Run eslint | |
id: run-linter | |
run: pnpm eslint | |
continue-on-error: true | |
- name: Check linter status code | |
run: test ${{ steps.run-linter.outcome }} != success |