-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "for now, remove all other builds and run on PRs"
This reverts commit 2264997.
- Loading branch information
Showing
6 changed files
with
367 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: 'Close stale issues and PRs' | ||
on: | ||
schedule: | ||
- cron: '0 * * * *' | ||
|
||
permissions: | ||
issues: write # to close stale issues (actions/stale) | ||
pull-requests: write # to close stale PRs (actions/stale) | ||
|
||
jobs: | ||
stale: | ||
name: 'Close month old issues and PRs' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v8 | ||
with: | ||
start-date: '2022-01-01T00:00:00Z' | ||
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.' | ||
stale-pr-message: 'This PR is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 30 days.' | ||
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.' | ||
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one.' | ||
days-before-issue-stale: 30 | ||
days-before-pr-stale: 90 | ||
days-before-issue-close: 30 | ||
days-before-pr-close: 30 | ||
exempt-all-milestones: true | ||
exempt-issue-labels: Pinned | ||
exempt-pr-labels: Pinned | ||
exempt-draft-pr: true | ||
operations-per-run: 1750 | ||
stale-legacy: | ||
name: 'Close year old issues and PRs' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/stale@v8 | ||
with: | ||
stale-issue-message: 'This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.' | ||
stale-pr-message: 'This PR is stale because it has been open 1 year with no activity. Remove stale label or comment or this will be closed in 30 days.' | ||
close-issue-message: 'This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.' | ||
close-pr-message: 'This PR was closed because it has been stalled for 30 days with no activity. Please open a new PR if the issue is still relevant, linking to this one.' | ||
days-before-issue-stale: 365 | ||
days-before-pr-stale: 365 | ||
days-before-issue-close: 30 | ||
days-before-pr-close: 30 | ||
exempt-all-milestones: true | ||
exempt-issue-labels: Pinned | ||
exempt-pr-labels: Pinned | ||
operations-per-run: 1750 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: 'Close issues' | ||
|
||
on: | ||
issues: | ||
types: [labeled] | ||
|
||
permissions: | ||
issues: write # to close issues (peter-evans/close-issue) | ||
|
||
jobs: | ||
questions: | ||
name: Questions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: "${{ github.event.label.name == ':speech_balloon: Question' }}" | ||
run: gh issue close $ISSUE --comment "Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions." | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE: ${{ github.event.issue.html_url }} | ||
bug-without-repro: | ||
name: Bug reports without reproductions | ||
runs-on: ubuntu-latest | ||
steps: | ||
- if: "${{ github.event.label.name == 'Needs Reproduction' }}" | ||
run: gh issue close $ISSUE --comment "As noted in the [Bug Report template](https://github.com/jestjs/jest/blob/main/.github/ISSUE_TEMPLATE/bug.yml), all bug reports requires a minimal reproduction. Please open up a new issue providing one. Read more at https://stackoverflow.com/help/minimal-reproducible-example." | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ISSUE: ${{ github.event.issue.html_url }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: 'Lock Threads' | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
|
||
permissions: {} | ||
jobs: | ||
lock: | ||
permissions: | ||
issues: write # to lock issues (dessant/lock-threads) | ||
pull-requests: write # to lock PRs (dessant/lock-threads) | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: dessant/lock-threads@v4 | ||
with: | ||
github-token: ${{ github.token }} | ||
issue-inactive-days: '30' | ||
exclude-any-issue-labels: 'Discussion' | ||
issue-comment: > | ||
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. | ||
Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions. | ||
pr-inactive-days: '30' | ||
pr-comment: > | ||
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. | ||
Please note this issue tracker is not a help forum. We recommend using [StackOverflow](https://stackoverflow.com/questions/tagged/jestjs) or our [discord channel](https://discord.gg/j6FKKQQrW9) for questions. | ||
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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,195 @@ | ||
name: Node CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
permissions: | ||
contents: read # to fetch code (actions/checkout) | ||
|
||
jobs: | ||
prepare-yarn-cache-ubuntu: | ||
uses: ./.github/workflows/prepare-cache.yml | ||
with: | ||
os: ubuntu-latest | ||
prepare-yarn-cache-macos: | ||
uses: ./.github/workflows/prepare-cache.yml | ||
with: | ||
os: macos-latest | ||
prepare-yarn-cache-windows: | ||
uses: ./.github/workflows/prepare-cache.yml | ||
with: | ||
os: windows-latest | ||
|
||
ts-compatibility: | ||
name: TypeScript Compatibility | ||
runs-on: ubuntu-latest | ||
needs: prepare-yarn-cache-ubuntu | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build | ||
- name: ts integration | ||
run: yarn test-ts --selectProjects ts-integration | ||
- name: type tests | ||
run: yarn test-ts --selectProjects type-tests | ||
- name: verify [email protected] compatibility | ||
run: yarn verify-old-ts | ||
- name: run ESLint with type info | ||
run: yarn lint-ts-files | ||
|
||
typecheck: | ||
name: Typecheck Examples and Tests | ||
runs-on: ubuntu-latest | ||
needs: prepare-yarn-cache-ubuntu | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build:ts | ||
- name: typecheck examples | ||
run: yarn typecheck:examples | ||
- name: typecheck tests | ||
run: yarn typecheck:tests | ||
|
||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
needs: prepare-yarn-cache-ubuntu | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build:js | ||
- name: verify Yarn PnP compatibility | ||
run: yarn verify-pnp | ||
- name: run eslint | ||
run: yarn lint | ||
- name: run prettier | ||
run: yarn lint:prettier:ci | ||
- name: check changelog | ||
run: yarn check-changelog | ||
- name: check copyright headers | ||
run: yarn check-copyright-headers | ||
|
||
yarn-validate: | ||
name: Validate Yarn dependencies and constraints | ||
runs-on: ubuntu-latest | ||
needs: prepare-yarn-cache-ubuntu | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: 'Check for unmet constraints (fix w/ "yarn constraints --fix")' | ||
run: yarn constraints | ||
- name: 'Check for duplicate dependencies (fix w/ "yarn dedupe")' | ||
run: yarn dedupe --check | ||
|
||
test-ubuntu: | ||
uses: ./.github/workflows/test.yml | ||
needs: prepare-yarn-cache-ubuntu | ||
with: | ||
os: ubuntu-latest | ||
test-macos: | ||
uses: ./.github/workflows/test.yml | ||
needs: prepare-yarn-cache-macos | ||
with: | ||
os: macos-latest | ||
test-windows: | ||
uses: ./.github/workflows/test.yml | ||
needs: prepare-yarn-cache-windows | ||
with: | ||
os: windows-latest | ||
|
||
test-leak: | ||
name: Node LTS on Ubuntu with leak detection | ||
runs-on: ubuntu-latest | ||
needs: prepare-yarn-cache-ubuntu | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Use Node.js LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build:js | ||
- name: run tests with leak detection | ||
run: yarn test-leak | ||
|
||
test-coverage: | ||
name: Node LTS on Ubuntu with coverage (${{ matrix.shard }}) | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shard: ['1/4', '2/4', '3/4', '4/4'] | ||
runs-on: ubuntu-latest | ||
needs: prepare-yarn-cache-ubuntu | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Use Node.js LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build:js | ||
- name: Get number of CPU cores | ||
id: cpu-cores | ||
uses: SimenB/github-actions-cpu-cores@v2 | ||
- name: run tests with coverage | ||
run: yarn jest-coverage --color --config jest.config.ci.mjs --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{ matrix.shard }} | ||
- name: map coverage | ||
run: node ./scripts/mapCoverage.mjs | ||
if: always() | ||
- uses: codecov/codecov-action@v3 | ||
if: always() | ||
with: | ||
directory: ./coverage |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Test | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
os: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
test: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
node-version: [14.x, 16.x, 18.x, 19.x, 20.x] | ||
shard: ['1/4', '2/4', '3/4', '4/4'] | ||
name: Node v${{ matrix.node-version }} on ${{ inputs.os }} (${{ matrix.shard }}) | ||
runs-on: ${{ inputs.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build:js | ||
- name: Get number of CPU cores | ||
id: cpu-cores | ||
uses: SimenB/github-actions-cpu-cores@v2 | ||
- name: run tests | ||
run: yarn test-ci-partial:parallel --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{ matrix.shard }} | ||
|
||
test-jasmine: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
shard: ['1/4', '2/4', '3/4', '4/4'] | ||
name: Node LTS on ${{ inputs.os }} using jest-jasmine2 (${{ matrix.shard }}) | ||
runs-on: ${{ inputs.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
persist-credentials: false | ||
- name: Use Node.js LTS | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: lts/* | ||
cache: yarn | ||
- name: install | ||
run: yarn --immutable | ||
- name: build | ||
run: yarn build:js | ||
- name: Get number of CPU cores | ||
id: cpu-cores | ||
uses: SimenB/github-actions-cpu-cores@v2 | ||
- name: run tests using jest-jasmine | ||
run: yarn jest-jasmine-ci --max-workers ${{ steps.cpu-cores.outputs.count }} --shard=${{ matrix.shard }} |