Skip to content

Commit 46bfcc3

Browse files
committed
chore(workflows): reorganize CI workflows and improve setup
1 parent 424f736 commit 46bfcc3

File tree

7 files changed

+59
-110
lines changed

7 files changed

+59
-110
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "Setup pnpm"
1+
name: "Setup"
22
description: "Install Node.js and pnpm and set up caching"
33
inputs:
44
node-version:
@@ -12,14 +12,21 @@ inputs:
1212
runs:
1313
using: "composite"
1414
steps:
15-
- name: Setup Node.js
15+
- uses: pnpm/action-setup@v4
16+
name: Install pnpm
17+
with:
18+
version: ${{ inputs.pnpm-version }}
19+
run_install: true
20+
21+
- name: Install Node.js
1622
uses: actions/setup-node@v4
1723
with:
1824
node-version: ${{ inputs.node-version }}
19-
cache: "pnpm"
20-
21-
- name: Enable Corepack
22-
run: corepack enable
25+
cache: 'pnpm'
2326

24-
- name: Install pnpm
25-
run: corepack prepare pnpm@${{ inputs.pnpm-version }} --activate
27+
# Build the SDK
28+
- name: Project build
29+
shell: bash
30+
run: pnpm build:clean
31+
env:
32+
NODE_ENV: ${{ inputs.node_env }}

.github/workflows/commitlint.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ jobs:
1414
commitlint:
1515
runs-on: ubuntu-22.04
1616
steps:
17-
- uses: actions/checkout@v4
18-
with:
19-
fetch-depth: 0
20-
- uses: actions/setup-node@v4
21-
with:
22-
node-version: 20
23-
- uses: pnpm/action-setup@v4
24-
name: Install pnpm
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
20+
- uses: ./.github/actions/setup
21+
name: Setup
2522
with:
26-
version: 9.1.0
27-
run_install: true
23+
node-version: ${{ matrix.node }}
24+
env:
25+
NODE_ENV: production
26+
2827
- name: Validate PR commits with commitlint
2928
if: github.event_name == 'pull_request'
3029
run: pnpx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
cron-tasks:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- name: check for inactive issues that can't be reproduced
15+
- name: Check for inactive issues that can't be reproduced
1616
uses: actions-cool/issues-helper@v3
1717
with:
1818
actions: 'close-issues'
@@ -25,6 +25,6 @@ jobs:
2525
2626
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.
2727
28-
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.
28+
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.
2929
3030
Thank you and have a great day!

.github/workflows/issues_handleLabel.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ jobs:
5050
5151
Hello @${{ github.event.issue.user.login }},
5252
53-
We ask that you please follow the [issue template](https://raw.githubusercontent.com/strapi/strapi/master/.github/ISSUE_TEMPLATE/BUG_REPORT.md).
53+
We ask that you please follow the [issue template](https://github.com/strapi/sdk-js/issues/new/choose).
5454
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).
5555
5656
Please update the issue with the template and we can reopen this report.
@@ -83,8 +83,6 @@ jobs:
8383
- questions should be directed to [our forum](https://forum.strapi.io) or our [Discord](https://discord.strapi.io)
8484
- feature requests should be directed to our [feedback and feature request database](https://feedback.strapi.io)
8585
86-
Please see the following contributing guidelines for asking a question [here](https://github.com/strapi/strapi/blob/master/CONTRIBUTING.md#reporting-an-issue).
87-
8886
Thank you.
8987
- name: 'Close: redirect question to community'
9088
if: "${{ github.event.label.name == 'flag: question' }}"

.github/workflows/tests.yml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/unit_tests.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: 'Unit Tests'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read # to fetch code (actions/checkout)
11+
actions: read
12+
13+
jobs:
14+
unit_tests:
15+
name: 'Unit Tests (node: ${{ matrix.node }})'
16+
runs-on: ubuntu-latest
17+
strategy:
18+
matrix:
19+
node: [20, 22]
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
24+
- uses: ./.github/actions/setup
25+
name: Setup
26+
with:
27+
node-version: ${{ matrix.node }}
28+
env:
29+
NODE_ENV: production
30+
31+
- name: Run tests
32+
run: pnpm run test

0 commit comments

Comments
 (0)