Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Setup"
description: "Install Node.js and pnpm and set up caching"
inputs:
node-version:
description: "Version of Node.js to use"
required: false
default: "22"
pnpm-version:
description: "Version of pnpm to install"
required: false
default: "9.1.0"
env:
description: "Build Environment"
required: false
default: "production"
runs:
using: "composite"
steps:
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: ${{ inputs.pnpm-version }}
run_install: true

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
cache: 'pnpm'

# Build the SDK
- name: Project build
shell: bash
run: pnpm build:clean
env:
NODE_ENV: ${{ inputs.node_env }}
78 changes: 78 additions & 0 deletions .github/workflows/bundle-size_compare.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: 'Bundle Sizes'

on:
pull_request:
pull_request_target:

jobs:
# Build and upload stats for `head`
build:
name: 'Upload ${{ matrix.target }} stats for ${{ github.event.pull_request.head.ref }}'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
target: [browser, node] # Runs for both browser and node bundles
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.ref }}

- name: Setup pnpm
uses: ./.github/actions/setup

- name: Upload stats.json
uses: actions/upload-artifact@v4
with:
name: head-stats-${{ matrix.target }}
path: .stats/bundle.${{ matrix.target }}.json

# Build base stats for comparison
build-base:
name: 'Upload ${{ matrix.target }} stats for ${{ github.base_ref }}'
runs-on: ubuntu-latest
permissions:
contents: read
strategy:
matrix:
target: [browser, node]
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}

- name: Setup pnpm
uses: ./.github/actions/setup

- name: Upload stats.json
uses: actions/upload-artifact@v4
with:
name: base-stats-${{ matrix.target }}
path: .stats/bundle.${{ matrix.target }}.json

# Compare base and head stats.json files
compare:
name: 'Bundle sizes comparison for ${{ matrix.target }}'
runs-on: ubuntu-latest
needs: [build, build-base]
permissions:
pull-requests: write
strategy:
matrix:
target: [browser, node]
steps:
- uses: actions/download-artifact@v4
with:
name: head-stats-${{ matrix.target }}

- uses: actions/download-artifact@v4
with:
name: base-stats-${{ matrix.target }}

- uses: twk3/[email protected]
with:
title: ${{ matrix.target }}
github-token: ${{ secrets.GITHUB_TOKEN }}
current-stats-json-path: ./head-stats-${{ matrix.target }}/bundle.${{ matrix.target }}.json
base-stats-json-path: ./base-stats-${{ matrix.target }}/bundle.${{ matrix.target }}.json
17 changes: 7 additions & 10 deletions .github/workflows/commitlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,14 @@ jobs:
commitlint:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/setup
name: Setup
with:
version: 9.1.0
run_install: true
node-version: ${{ matrix.node }}

- name: Validate PR commits with commitlint
if: github.event_name == 'pull_request'
run: pnpx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
cron-tasks:
runs-on: ubuntu-latest
steps:
- name: check for inactive issues that can't be reproduced
- name: Check for inactive issues that can't be reproduced
uses: actions-cool/issues-helper@v3
with:
actions: 'close-issues'
Expand All @@ -25,6 +25,6 @@ jobs:

As we have not received any new or updated information to reproduce this issue in the last 14 days we are marking this issue as closed. Should you have new information please feel free to respond and we will consider reopening it.

If anyone else has updated information for this issue, please open up a new bug report and simply reference this closed bug report so that we can get any new information you may have. If you have questions please refer to the [contributor's guide](https://github.com/strapi/strapi/blob/main/CONTRIBUTING.md#reporting-an-issue) on opening issues.
If anyone else has updated information for this issue, please open up a new bug report and simply reference this closed bug report so that we can get any new information you may have.

Thank you and have a great day!
4 changes: 1 addition & 3 deletions .github/workflows/issues_handleLabel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:

Hello @${{ github.event.issue.user.login }},

We ask that you please follow the [issue template](https://raw.githubusercontent.com/strapi/strapi/master/.github/ISSUE_TEMPLATE/BUG_REPORT.md).
We ask that you please follow the [issue template](https://github.com/strapi/sdk-js/issues/new/choose).
A proper issue submission let's us better understand the origin of your bug and therefore help you. We will reopen your issue when we receive the issue following the template guidelines and properly fill out the template. You can see the template guidelines for bug reports [here](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md#reporting-an-issue).

Please update the issue with the template and we can reopen this report.
Expand Down Expand Up @@ -83,8 +83,6 @@ jobs:
- questions should be directed to [our forum](https://forum.strapi.io) or our [Discord](https://discord.strapi.io)
- feature requests should be directed to our [feedback and feature request database](https://feedback.strapi.io)

Please see the following contributing guidelines for asking a question [here](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md#reporting-an-issue).

Thank you.
- name: 'Close: redirect question to community'
if: "${{ github.event.label.name == 'flag: question' }}"
Expand Down
87 changes: 0 additions & 87 deletions .github/workflows/tests.yml

This file was deleted.

30 changes: 30 additions & 0 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: 'Unit Tests'

on:
push:
branches:
- main
pull_request:

permissions:
contents: read # to fetch code (actions/checkout)
actions: read

jobs:
unit_tests:
name: 'Unit Tests (node: ${{ matrix.node }})'
runs-on: ubuntu-latest
strategy:
matrix:
node: [20, 22]
steps:
- name: Checkout
uses: actions/checkout@v4

- uses: ./.github/actions/setup
name: Setup
with:
node-version: ${{ matrix.node }}

- name: Run tests
run: pnpm run test
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ nbproject

.coverage
.node_history
.stats
dist
lcov.info
lib-cov
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
"prettier": "3.3.3",
"rimraf": "6.0.1",
"rollup": "4.27.3",
"rollup-plugin-visualizer": "5.12.0",
"ts-jest": "29.2.5",
"typescript": "5.6.3"
},
Expand Down
Loading
Loading