Skip to content

Commit 3a928fb

Browse files
committed
build: update error databases
1 parent cfbdacf commit 3a928fb

1 file changed

Lines changed: 105 additions & 0 deletions

File tree

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
#/
2+
# @license Apache-2.0
3+
#
4+
# Copyright (c) 2023 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: update_error_databases
21+
22+
# Workflow triggers:
23+
on:
24+
schedule:
25+
# Run the workflow once a week (Sunday at midnight):
26+
- cron: '0 0 * * 0'
27+
28+
# Allow the workflow to be manually run:
29+
workflow_dispatch:
30+
31+
# Workflow jobs:
32+
jobs:
33+
34+
# Define a job for updating the error databases:
35+
update:
36+
37+
# Define a display name:
38+
name: 'Update Error Databases'
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+
# Checkout the repository:
47+
- name: 'Checkout repository'
48+
uses: actions/checkout@v3
49+
with:
50+
# Specify whether to remove untracked files before checking out the repository:
51+
clean: true
52+
53+
# Limit clone depth to the most recent commit:
54+
fetch-depth: 1
55+
56+
# Specify whether to download Git-LFS files:
57+
lfs: false
58+
timeout-minutes: 10
59+
60+
# Install Node.js:
61+
- name: 'Install Node.js'
62+
uses: actions/setup-node@v3
63+
with:
64+
node-version: '16' # 'lts/*'
65+
timeout-minutes: 5
66+
67+
# Install dependencies (accounting for possible network failures, etc, when installing node module dependencies):
68+
- name: 'Install dependencies'
69+
run: |
70+
make install-node-modules || make install-node-modules || make install-node-modules
71+
timeout-minutes: 15
72+
73+
# Update the error databases:
74+
- name: 'Update error databases'
75+
run: |
76+
node lib/node_modules/@stdlib/error/tools/database/scripts/build.js
77+
node lib/node_modules/@stdlib/error/tools/pkg2id/scripts/build.js
78+
node lib/node_modules/@stdlib/error/tools/id2pkg/scripts/build.js
79+
80+
# Disable Git hooks:
81+
- name: 'Disable Git hooks'
82+
run: |
83+
rm -rf .git/hooks
84+
85+
# Create a pull request with the updated declarations:
86+
- name: 'Create pull request'
87+
id: cpr
88+
uses: peter-evans/create-pull-request@v4
89+
with:
90+
title: 'Update error databases'
91+
body: |
92+
This PR
93+
94+
- updates the error databases
95+
96+
commit-message: 'feat: update error databases'
97+
committer: 'stdlib-bot <noreply@stdlib.io>'
98+
token: ${{ secrets.PULL_REQUEST_TOKEN }}
99+
labels: |
100+
documentation
101+
automated-pr
102+
team-reviewers: |
103+
stdlib-reviewers
104+
branch: update-error-databases
105+
delete-branch: true

0 commit comments

Comments
 (0)