Skip to content

Commit 6ba28fe

Browse files
Merge branch 'stdlib-js:develop' into develop
2 parents 3f61e2c + d7798af commit 6ba28fe

File tree

703 files changed

+46460
-1218
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

703 files changed

+46460
-1218
lines changed

.github/labeler.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
BLAS:
20+
- changed-files:
21+
- any-glob-to-any-file: '**/blas/**/*'
22+
23+
Math:
24+
- changed-files:
25+
- any-glob-to-any-file: '**/math/**/*'

.github/workflows/labeler.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2024 The Stdlib Authors.
5+
#
6+
# Licensed under the Apache License, Version 2.0 (the "License");
7+
# you may not use this file except in compliance with the License.
8+
# You may obtain a copy of the License at
9+
#
10+
# http://www.apache.org/licenses/LICENSE-2.0
11+
#
12+
# Unless required by applicable law or agreed to in writing, software
13+
# distributed under the License is distributed on an "AS IS" BASIS,
14+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
# See the License for the specific language governing permissions and
16+
# limitations under the License.
17+
#/
18+
19+
# Workflow name:
20+
name: 'labeler'
21+
22+
# Workflow triggers:
23+
on:
24+
pull_request_target:
25+
26+
# Workflow jobs:
27+
jobs:
28+
29+
# Define a job which automatically labels pull requests based on the contents of the pull request:
30+
labeler:
31+
32+
# Define job name:
33+
name: 'Labeler'
34+
35+
# Define job permissions:
36+
permissions:
37+
contents: read
38+
pull-requests: write
39+
40+
# Define the type of virtual host machine:
41+
runs-on: ubuntu-latest
42+
43+
# Define the sequence of job steps:
44+
steps:
45+
46+
# Automatically label pull requests:
47+
- name: 'Automatically label pull requests'
48+
# Pin action to full length commit SHA
49+
uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
50+
with:
51+
configuration-path: .github/labeler.yml
52+
repo-token: ${{ secrets.CHATBOT_GITHUB_TOKEN }}

.github/workflows/lint_autofix.yml

Lines changed: 153 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -17,156 +17,156 @@
1717
#/
1818

1919
# Workflow name:
20-
name: lint_autofix
21-
22-
# Workflow triggers:
23-
on:
24-
25-
# Allow the workflow to be triggered by other workflows
26-
workflow_call:
27-
# Define the input parameters for the workflow:
28-
inputs:
29-
pull_request_number:
30-
description: 'PR number'
31-
required: true
32-
type: number
33-
# Define the secrets accessible by the workflow:
34-
secrets:
35-
STDLIB_BOT_GITHUB_TOKEN:
36-
description: 'GitHub token for stdlb-bot'
37-
required: true
38-
REPO_GITHUB_TOKEN:
39-
description: 'GitHub token for accessing the repository'
40-
required: true
41-
STDLIB_BOT_GPG_PRIVATE_KEY:
42-
description: 'GPG private key for stdlb-bot'
43-
required: true
44-
STDLIB_BOT_GPG_PASSPHRASE:
45-
description: 'GPG passphrase for stdlb-bot'
46-
required: true
47-
48-
# Workflow jobs:
49-
jobs:
50-
51-
# Define a job for automatically fixing lint errors:
52-
autofix:
53-
54-
# Define a display name:
55-
name: 'Fix lint errors'
56-
57-
# Define the type of virtual host machine:
58-
runs-on: ubuntu-latest
59-
60-
# Define the sequence of job steps...
61-
steps:
62-
63-
# Get PR details:
64-
- name: 'Get PR details'
65-
id: pr-details
66-
run: |
67-
pr_response=$(curl -s \
68-
-H "Accept: application/vnd.github.v3+json" \
69-
-H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}" \
70-
"https://api.github.com/repos/stdlib-js/stdlib/pulls/${{ inputs.pull_request_number }}")
71-
72-
# Escape control characters:
73-
pr_response=$(echo "$pr_response" | tr -d '\000-\031')
74-
75-
# Extract the needed details:
76-
pr_branch=$(echo "$pr_response" | jq -r '.head.ref') # PR's branch
77-
pr_repo_full_name=$(echo "$pr_response" | jq -r '.head.repo.full_name') # PR's repo full name
78-
79-
# Set outputs for the branch and repository:
80-
echo "branch=$pr_branch" >> $GITHUB_OUTPUT
81-
echo "repository=$pr_repo_full_name" >> $GITHUB_OUTPUT
82-
83-
# Checkout the repository:
84-
- name: 'Checkout repository'
85-
# Pin action to full length commit SHA
86-
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
87-
with:
88-
# Refers to the branch name of the branch being pushed:
89-
ref: ${{ steps.pr-details.outputs.branch }}
90-
91-
# Refers to the repository name:
92-
repository: ${{ steps.pr-details.outputs.repository }}
93-
94-
# Token for accessing the repository:
95-
token: ${{ secrets.REPO_GITHUB_TOKEN }}
96-
97-
# File path to checkout to:
98-
path: './'
99-
100-
# Install Node.js:
101-
- name: 'Install Node.js'
102-
# Pin action to full length commit SHA
103-
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
104-
with:
105-
node-version: '20' # 'lts/*'
106-
timeout-minutes: 5
107-
108-
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
109-
- name: 'Install dependencies'
110-
run: |
111-
make install-node-modules || make install-node-modules || make install-node-modules
112-
timeout-minutes: 15
113-
114-
# Initialize development environment:
115-
- name: 'Initialize development environment'
116-
run: |
117-
make init
118-
timeout-minutes: 5
119-
120-
# Get list of changed files:
121-
- name: 'Get list of changed files'
122-
id: changed-files
123-
run: |
124-
page=1
125-
files=""
126-
while true; do
127-
changed_files=$(curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN
128-
}}" "https://api.github.com/repos/stdlib-js/stdlib/pulls/${{ inputs.pull_request_number }}/files?page=$page&per_page=100" | jq -r '.[] | .filename')
129-
if [ -z "$changed_files" ]; then
130-
break
131-
fi
132-
files="$files $changed_files"
133-
page=$((page+1))
134-
done
135-
files=$(echo "$files" | tr '\n' ' ' | sed 's/^ //;s/ $//')
136-
echo "files=${files}" >> $GITHUB_OUTPUT
137-
138-
# Fix JavaScript lint errors:
139-
- name: 'Fix JavaScript lint errors'
140-
id: fix-lint-errors
141-
run: |
142-
files="${{ steps.changed-files.outputs.files }}"
143-
FIX=1 . "$GITHUB_WORKSPACE/.github/workflows/scripts/lint_javascript_files" "$files"
144-
145-
# Disable Git hooks:
146-
- name: 'Disable Git hooks'
147-
run: |
148-
rm -rf .git/hooks
149-
150-
# Import GPG key to sign commits:
151-
- name: 'Import GPG key to sign commits'
152-
# Pin action to full length commit SHA
153-
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
154-
with:
155-
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
156-
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
157-
git_user_signingkey: true
158-
git_commit_gpgsign: true
159-
160-
# Commit and push changes:
161-
- name: 'Commit and push changes'
162-
env:
163-
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
164-
USER_NAME: stdlb-bot
165-
BRANCH_NAME: ${{ steps.pr-details.outputs.branch }}
166-
REPO_NAME: ${{ steps.pr-details.outputs.repository }}
167-
run: |
168-
git config --local user.email "[email protected]"
169-
git config --local user.name "stdlib-bot"
170-
git add .
171-
git commit -m "fix: resolve lint errors"
172-
git push "https://$USER_NAME:[email protected]/$REPO_NAME.git" $BRANCH_NAME
20+
name: lint_autofix
21+
22+
# Workflow triggers:
23+
on:
24+
25+
# Allow the workflow to be triggered by other workflows
26+
workflow_call:
27+
# Define the input parameters for the workflow:
28+
inputs:
29+
pull_request_number:
30+
description: 'PR number'
31+
required: true
32+
type: number
33+
# Define the secrets accessible by the workflow:
34+
secrets:
35+
STDLIB_BOT_GITHUB_TOKEN:
36+
description: 'GitHub token for stdlb-bot'
37+
required: true
38+
REPO_GITHUB_TOKEN:
39+
description: 'GitHub token for accessing the repository'
40+
required: true
41+
STDLIB_BOT_GPG_PRIVATE_KEY:
42+
description: 'GPG private key for stdlb-bot'
43+
required: true
44+
STDLIB_BOT_GPG_PASSPHRASE:
45+
description: 'GPG passphrase for stdlb-bot'
46+
required: true
47+
48+
# Workflow jobs:
49+
jobs:
50+
51+
# Define a job for automatically fixing lint errors:
52+
autofix:
53+
54+
# Define a display name:
55+
name: 'Fix lint errors'
56+
57+
# Define the type of virtual host machine:
58+
runs-on: ubuntu-latest
59+
60+
# Define the sequence of job steps...
61+
steps:
62+
63+
# Get PR details:
64+
- name: 'Get PR details'
65+
id: pr-details
66+
run: |
67+
pr_response=$(curl -s \
68+
-H "Accept: application/vnd.github.v3+json" \
69+
-H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}" \
70+
"https://api.github.com/repos/stdlib-js/stdlib/pulls/${{ inputs.pull_request_number }}")
71+
72+
# Escape control characters:
73+
pr_response=$(echo "$pr_response" | tr -d '\000-\031')
74+
75+
# Extract the needed details:
76+
pr_branch=$(echo "$pr_response" | jq -r '.head.ref') # PR's branch
77+
pr_repo_full_name=$(echo "$pr_response" | jq -r '.head.repo.full_name') # PR's repo full name
78+
79+
# Set outputs for the branch and repository:
80+
echo "branch=$pr_branch" >> $GITHUB_OUTPUT
81+
echo "repository=$pr_repo_full_name" >> $GITHUB_OUTPUT
82+
83+
# Checkout the repository:
84+
- name: 'Checkout repository'
85+
# Pin action to full length commit SHA
86+
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
87+
with:
88+
# Refers to the branch name of the branch being pushed:
89+
ref: ${{ steps.pr-details.outputs.branch }}
90+
91+
# Refers to the repository name:
92+
repository: ${{ steps.pr-details.outputs.repository }}
93+
94+
# Token for accessing the repository:
95+
token: ${{ secrets.REPO_GITHUB_TOKEN }}
96+
97+
# File path to checkout to:
98+
path: './'
99+
100+
# Install Node.js:
101+
- name: 'Install Node.js'
102+
# Pin action to full length commit SHA
103+
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
104+
with:
105+
node-version: '20' # 'lts/*'
106+
timeout-minutes: 5
107+
108+
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
109+
- name: 'Install dependencies'
110+
run: |
111+
make install-node-modules || make install-node-modules || make install-node-modules
112+
timeout-minutes: 15
113+
114+
# Initialize development environment:
115+
- name: 'Initialize development environment'
116+
run: |
117+
make init
118+
timeout-minutes: 5
119+
120+
# Get list of changed files:
121+
- name: 'Get list of changed files'
122+
id: changed-files
123+
run: |
124+
page=1
125+
files=""
126+
while true; do
127+
changed_files=$(curl -s -H "Accept: application/vnd.github.v3+json" -H "Authorization: Bearer ${{ secrets.STDLIB_BOT_GITHUB_TOKEN
128+
}}" "https://api.github.com/repos/stdlib-js/stdlib/pulls/${{ inputs.pull_request_number }}/files?page=$page&per_page=100" | jq -r '.[] | .filename')
129+
if [ -z "$changed_files" ]; then
130+
break
131+
fi
132+
files="$files $changed_files"
133+
page=$((page+1))
134+
done
135+
files=$(echo "$files" | tr '\n' ' ' | sed 's/^ //;s/ $//')
136+
echo "files=${files}" >> $GITHUB_OUTPUT
137+
138+
# Fix JavaScript lint errors:
139+
- name: 'Fix JavaScript lint errors'
140+
id: fix-lint-errors
141+
run: |
142+
files="${{ steps.changed-files.outputs.files }}"
143+
FIX=1 . "$GITHUB_WORKSPACE/.github/workflows/scripts/lint_javascript_files" "$files"
144+
145+
# Disable Git hooks:
146+
- name: 'Disable Git hooks'
147+
run: |
148+
rm -rf .git/hooks
149+
150+
# Import GPG key to sign commits:
151+
- name: 'Import GPG key to sign commits'
152+
# Pin action to full length commit SHA
153+
uses: crazy-max/ghaction-import-gpg@01dd5d3ca463c7f10f7f4f7b4f177225ac661ee4 # v6.1.0
154+
with:
155+
gpg_private_key: ${{ secrets.STDLIB_BOT_GPG_PRIVATE_KEY }}
156+
passphrase: ${{ secrets.STDLIB_BOT_GPG_PASSPHRASE }}
157+
git_user_signingkey: true
158+
git_commit_gpgsign: true
159+
160+
# Commit and push changes:
161+
- name: 'Commit and push changes'
162+
env:
163+
REPO_GITHUB_TOKEN: ${{ secrets.REPO_GITHUB_TOKEN }}
164+
USER_NAME: stdlb-bot
165+
BRANCH_NAME: ${{ steps.pr-details.outputs.branch }}
166+
REPO_NAME: ${{ steps.pr-details.outputs.repository }}
167+
run: |
168+
git config --local user.email "[email protected]"
169+
git config --local user.name "stdlib-bot"
170+
git add .
171+
git commit -m "fix: resolve lint errors"
172+
git push "https://$USER_NAME:[email protected]/$REPO_NAME.git" $BRANCH_NAME

0 commit comments

Comments
 (0)