Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/main' into feature/comparative…
Browse files Browse the repository at this point in the history
…-benchmarks
  • Loading branch information
MarlonPassos-git committed Nov 23, 2024
2 parents bf648ad + 7430ba4 commit 15c498b
Show file tree
Hide file tree
Showing 144 changed files with 7,001 additions and 8,805 deletions.
6 changes: 5 additions & 1 deletion .github/contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Once you've made your changes on a fork of the Radashi repo, create a pull reque

Once you submit your PR, one of Radashi's maintainers will review it. They might ask questions or request additional information.

## Your PR gets labeled with `prerelease`

If your PR is labeled with `prerelease` by a maintainer, it will be published in either a `beta` or `next` version to NPM. You should be notified by the Radashi Bot when this happens. PRs for bug fixes are never published as prereleases.

## Your PR gets merged!

Congratulations :tada::tada: Currently, official versions are published manually. But beta versions are published automatically, every day, at 5:00AM UTC (if a PR has been merged). Your PR will be updated with a comment when the next release is published.
Congratulations :tada::tada: Currently, major and minor versions are published manually. If your PR was a bug fix, it will be immediately published to NPM as a patch version. Otherwise, you can use a `beta` or `next` version if you can't wait for your feature to be released.
8 changes: 7 additions & 1 deletion .github/next-minor.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@ The `####` headline should be short and descriptive of the new functionality. In

## New Features

####
#### Add `signal` option to `retry`

https://github.com/radashi-org/radashi/pull/262

#### Add `signal` option to `parallel`

https://github.com/radashi-org/radashi/pull/262
3 changes: 0 additions & 3 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
Consider opening a feature request first to get your change idea approved.
-->

> [!TIP]
> The owner of this PR can publish a _preview release_ by commenting `/publish` in this PR. Afterwards, anyone can try it out by running `pnpm add radashi@pr<PR_NUMBER>`.
## Summary

<!-- Describe what the change does and why it should be merged. -->
Expand Down
10 changes: 1 addition & 9 deletions .github/workflows/bench-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,8 @@ jobs:
node-version: '22.x'
cache: pnpm

- name: Install dependencies
run: |
# Only install Vitest for the root directory.
echo '{"type":"module","dependencies":{"vitest":"2.0.5"}}' > package.json
pnpm install --no-frozen-lockfile
pnpm install -C scripts/benchmarks
pnpm install -C scripts/radashi-db
- name: Run benchmarks
env:
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
run: |
./scripts/benchmarks/node_modules/.bin/tsx ./scripts/benchmarks/ci-bench-main.ts
node scripts/run bench-main
30 changes: 8 additions & 22 deletions .github/workflows/bench-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,44 +15,30 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/action-setup@v4
- name: Install Node.js
uses: actions/setup-node@v4
with:
cache: pnpm

- name: Checkout Pull Request
id: checkout
env:
PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
bash scripts/checkout-pr.sh src benchmarks
node scripts/run checkout-pr src benchmarks
if [ -z "$(git status --porcelain)" ]; then
echo '::set-output name=has_changes::false'
else
echo '::set-output name=has_changes::true'
fi
- name: Install pnpm
if: steps.checkout.outputs.has_changes == 'true'
uses: pnpm/action-setup@v4

- name: Install Node.js
if: steps.checkout.outputs.has_changes == 'true'
uses: actions/setup-node@v4
with:
cache: pnpm

- name: Install dependencies
if: steps.checkout.outputs.has_changes == 'true'
run: |
# Only install Vitest for the root directory.
echo '{"type":"module","dependencies":{"vitest":"2.0.5"}}' > package.json
pnpm install --no-frozen-lockfile
pnpm install -C scripts/benchmarks
pnpm install -C scripts/radashi-db
- name: Run benchmarks
if: steps.checkout.outputs.has_changes == 'true'
env:
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
run: |
./scripts/benchmarks/node_modules/.bin/tsx ./scripts/benchmarks/ci-bench-pr.ts ${{ github.base_ref }} ${{ github.event.number }} ${{ github.event.pull_request.head.repo.html_url }}/blob/${{ github.event.pull_request.head.sha }}
node scripts/run bench-pr ${{ github.base_ref }} ${{ github.event.number }} ${{ github.event.pull_request.head.repo.html_url }}/blob/${{ github.event.pull_request.head.sha }}
7 changes: 1 addition & 6 deletions .github/workflows/bundle-impact.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,10 @@ jobs:
with:
cache: pnpm

- name: Install dependencies
if: steps.checkout.outputs.has_changes == 'true'
run: |
pnpm install -C scripts/bundle-impact
- name: Run Bundle Impact
if: steps.checkout.outputs.has_changes == 'true'
env:
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
TARGET_BRANCH: ${{ github.base_ref }}
run: |
./scripts/bundle-impact/node_modules/.bin/tsx ./scripts/bundle-impact/pr-bundle-impact.ts ${{ github.event.number }}
node scripts/run bundle-impact ${{ github.event.number }}
42 changes: 42 additions & 0 deletions .github/workflows/check-main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Check main branch

on:
workflow_dispatch:
push:
branches: [main]
paths: ['src/**', 'tests/**']

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install
- run: pnpm test

validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm
- run: pnpm install
- name: Lint
run: pnpm lint
- name: Check Build
run: pnpm build
9 changes: 3 additions & 6 deletions .github/workflows/prerelease-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,13 @@ jobs:
node-version: '22.x'
cache: pnpm

- name: Install script dependencies
run: |
pnpm install -C scripts/prerelease
- name: Publish
- name: Merge PR into target branch
continue-on-error: true
env:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
PR_NUMBER: ${{ github.event.pull_request.number }}
PR_TITLE: ${{ github.event.pull_request.title }}
PR_REPO_URL: ${{ github.event.pull_request.head.repo.clone_url }}
PR_HEAD_REF: ${{ github.event.pull_request.head.ref }}
run: |
./scripts/prerelease/node_modules/.bin/tsx ./scripts/prerelease/ci-prerelease.ts
node scripts/run prerelease-pr
17 changes: 4 additions & 13 deletions .github/workflows/publish-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ name: Publish radashi@beta

on:
workflow_dispatch:
schedule:
- cron: '0 5 * * *'
push:
branches: [beta, next]
paths: ['src/**']

jobs:
test:
Expand All @@ -22,11 +23,6 @@ jobs:
cache: pnpm
- run: pnpm install
- run: pnpm test
- if: ${{ matrix.node-version == '22.x' }}
name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

validate:
name: Validate
Expand Down Expand Up @@ -65,11 +61,6 @@ jobs:
- run: pnpm install
- run: pnpm build

- name: Install script dependencies
run: |
pnpm install -C scripts/versions
pnpm install -C scripts/radashi-db
- name: Publish
env:
GIT_CLIFF_PAT: ${{ secrets.GIT_CLIFF_PAT }}
Expand All @@ -79,4 +70,4 @@ jobs:
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
NIGHTLY_DEPLOY_KEY: ${{ secrets.NIGHTLY_DEPLOY_KEY }}
run: |
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish.ts --tag beta
node scripts/run publish-version --tag ${{ github.ref_name }}
7 changes: 1 addition & 6 deletions .github/workflows/publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,9 @@ jobs:
node-version: '22.x'
cache: pnpm

- name: Install dependencies
run: |
pnpm install -C scripts/docs
pnpm install -C scripts/radashi-db
- name: Publish
env:
DOCS_DEPLOY_KEY: ${{ secrets.DOCS_DEPLOY_KEY }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
run: |
./scripts/docs/node_modules/.bin/tsx ./scripts/docs/ci-publish-docs.ts ${{ github.event.ref }}
node scripts/run publish-docs ${{ github.event.ref }}
49 changes: 2 additions & 47 deletions .github/workflows/publish-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,50 +4,10 @@ on:
workflow_dispatch:

jobs:
test:
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x, 20.x, 22.x]
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- run: pnpm install
- run: pnpm test
- if: ${{ matrix.node-version == '22.x' }}
name: Upload coverage reports to Codecov
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

validate:
name: Validate
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm
- run: pnpm install
- name: Lint
run: pnpm lint
- name: Check Build
run: pnpm build

publish-latest:
if: ${{ github.ref == 'refs/heads/main' }}
name: Publish Latest
needs: [test, validate]
runs-on: ubuntu-latest
continue-on-error: true
permissions:
id-token: write
steps:
Expand All @@ -63,11 +23,6 @@ jobs:
- run: pnpm install
- run: pnpm build

- name: Install script dependencies
run: |
pnpm install -C scripts/versions
pnpm install -C scripts/radashi-db
- name: Publish
env:
GIT_CLIFF_PAT: ${{ secrets.GIT_CLIFF_PAT }}
Expand All @@ -76,4 +31,4 @@ jobs:
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
run: |
./scripts/versions/node_modules/.bin/tsx ./scripts/versions/ci-publish.ts --latest
node scripts/run publish-version --latest
38 changes: 38 additions & 0 deletions .github/workflows/publish-patch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish patch

on:
workflow_run:
workflows: ['Check main branch']
types:
- completed

jobs:
publish:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Publish
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
registry-url: 'https://registry.npmjs.org'
node-version: '22.x'
cache: pnpm
- run: pnpm install
- run: pnpm build

- name: Publish
env:
GIT_CLIFF_PAT: ${{ secrets.GIT_CLIFF_PAT }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
RADASHI_BOT_TOKEN: ${{ secrets.RADASHI_BOT_TOKEN }}
SUPABASE_KEY: ${{ secrets.SUPABASE_KEY }}
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
NIGHTLY_DEPLOY_KEY: ${{ secrets.NIGHTLY_DEPLOY_KEY }}
run: |
node scripts/run publish-version --patch
Loading

0 comments on commit 15c498b

Please sign in to comment.