-
Notifications
You must be signed in to change notification settings - Fork 422
chore: simplify and standardize package.json
scripts and CI setup
#7069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
b57d815
chore(package.json): simplify site build
serhalp be729a2
refactor(scripts): split up prepare-for-publish
serhalp 2593f33
chore: remove bizarre postinstall hook that builds
serhalp 5c3f767
chore: remove leftover refs to ava
serhalp f4119f8
ci: rename misleading jobs
serhalp bf2bfa2
chore: split formating, linting, and unit testing
serhalp 846d1c4
ci: simplify workflow skipping for release branches
serhalp 7169000
chore(package.json): sort scripts
serhalp ec2e860
chore(deps): add missing dependency on npm-run-all
serhalp 1b778f0
Merge branch 'main' into chore/remove-postinstall-hook
serhalp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Format | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
format: | ||
name: Format | ||
if: "${{ !startsWith(github.head_ref, 'release-') }}" | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: npm | ||
- name: Install core dependencies | ||
run: npm ci --no-audit | ||
- name: Check format | ||
run: npm run format |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ on: | |
jobs: | ||
integration: | ||
name: Integration | ||
if: "${{ !startsWith(github.head_ref, 'release-') }}" | ||
runs-on: ${{ matrix.os }} | ||
timeout-minutes: 40 | ||
strategy: | ||
|
@@ -27,55 +28,41 @@ jobs: | |
node-version: '22' | ||
fail-fast: false | ||
steps: | ||
# Sets an output parameter if this is a release PR | ||
- name: Check for release | ||
id: release-check | ||
# For windows we have to use $env: | ||
run: |- | ||
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT | ||
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT | ||
if: "${{ startsWith(github.head_ref, 'release-') }}" | ||
# This improves Windows network performance, we need this since we open many ports in our tests | ||
- name: Increase Windows port limit and reduce time wait delay | ||
run: | | ||
netsh int ipv4 set dynamicport tcp start=1025 num=64511 | ||
REG ADD HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\TCPIP\Parameters /v TcpTimedWaitDelay /t REG_DWORD /d 30 /f | ||
if: "${{ matrix.os == 'windows-latest' && !steps.release-check.outputs.IS_RELEASE }}" | ||
if: "${{ matrix.os == 'windows-latest' }}" | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: npm | ||
check-latest: true | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Install PNPM | ||
run: | | ||
corepack enable | ||
corepack prepare [email protected] --activate | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
with: | ||
deno-version: v1.44.4 | ||
- name: Install core dependencies | ||
run: npm ci --no-audit | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Build package | ||
run: npm run build | ||
- name: Generate self-signed certificates | ||
run: npm run certs | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
shell: bash | ||
- name: Prepare tests | ||
run: npm run test:init | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
- name: Tests | ||
uses: nick-fields/retry@v3 | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
with: | ||
timeout_minutes: 15 | ||
max_attempts: 3 | ||
|
@@ -103,7 +90,6 @@ jobs: | |
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT | ||
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT | ||
shell: bash | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
|
||
- name: Sanitize shard for artefact name | ||
id: sanitize-shard-name | ||
|
@@ -122,22 +108,14 @@ jobs: | |
with: | ||
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
# Specific tests for known test that failed on windows using node 23. | ||
# Can be replaced with larger node 23 tests in the future. | ||
integration-win-node-23: | ||
name: Integration test windows latest node23 specific | ||
if: "${{ !startsWith(github.head_ref, 'release-') }}" | ||
runs-on: windows-latest | ||
timeout-minutes: 40 | ||
steps: | ||
# Sets an output parameter if this is a release PR | ||
- name: Check for release | ||
id: release-check | ||
# For windows we have to use $env: | ||
run: |- | ||
echo "IS_RELEASE=true" >> $GITHUB_OUTPUT | ||
echo "IS_RELEASE=true" >> $env:GITHUB_OUTPUT | ||
if: "${{ startsWith(github.head_ref, 'release-') }}" | ||
# This improves Windows network performance, we need this since we open many ports in our tests | ||
- name: Increase Windows port limit and reduce time wait delay | ||
run: | | ||
|
@@ -147,37 +125,31 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '23.x' | ||
cache: npm | ||
check-latest: true | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Install PNPM | ||
run: | | ||
corepack enable | ||
corepack prepare [email protected] --activate | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Setup Deno | ||
uses: denoland/setup-deno@v1 | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
with: | ||
deno-version: v1.44.4 | ||
- name: Install core dependencies | ||
run: npm ci --no-audit | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
- name: Build package | ||
run: npm run build | ||
- name: Generate self-signed certificates | ||
run: npm run certs | ||
if: '${{!steps.release-check.outputs.IS_RELEASE}}' | ||
shell: bash | ||
- name: Prepare tests | ||
run: npm run test:init | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
- name: Tests | ||
uses: nick-fields/retry@v3 | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
with: | ||
timeout_minutes: 15 | ||
max_attempts: 3 | ||
|
@@ -205,7 +177,6 @@ jobs: | |
echo "node=node_${node/.*.*/}" >> $GITHUB_OUTPUT | ||
echo "node=node_${node/.*.*/}" >> $env:GITHUB_OUTPUT | ||
shell: bash | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' | ||
|
||
- name: Store npm error artefacts | ||
uses: actions/upload-artifact@v4 | ||
|
@@ -220,4 +191,3 @@ jobs: | |
with: | ||
flags: ${{ steps.test-coverage-flags.outputs.os }},${{ steps.test-coverage-flags.outputs.node }} | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
if: '${{ !steps.release-check.outputs.IS_RELEASE }}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Lint | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
if: "${{ !startsWith(github.head_ref, 'release-') }}" | ||
steps: | ||
- name: Git checkout | ||
uses: actions/checkout@v4 | ||
- name: Set up Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 22 | ||
cache: npm | ||
- name: Install core dependencies | ||
run: npm ci --no-audit | ||
- name: Run lint | ||
run: npm run lint |
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
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
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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whoops, my editor reformatted this. I can revert it if the reviewer cares.