Skip to content

Commit 6011fb7

Browse files
committed
Add comments to workflow templates
1 parent 3612d56 commit 6011fb7

File tree

7 files changed

+249
-44
lines changed

7 files changed

+249
-44
lines changed

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_benchmark.yml.txt

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,42 @@ name: benchmark
2121

2222
# Workflow triggers:
2323
on:
24+
# Allow the workflow to be manually run:
2425
workflow_dispatch:
2526

2627
# Workflow jobs:
2728
jobs:
29+
30+
# Define a job to run benchmarks:
2831
benchmark:
29-
runs-on: ubuntu-latest
32+
33+
# Define a display name:
34+
name: 'Run benchmarks'
35+
36+
# Define the type of virtual host machine:
37+
runs-on: 'ubuntu-latest'
38+
39+
# Define the sequence of job steps...
3040
steps:
31-
- uses: actions/checkout@v3
32-
- uses: actions/setup-node@v2
41+
42+
# Checkout the repository:
43+
- name: 'Checkout repository'
44+
uses: actions/checkout@v3
45+
46+
# Install Node.js
47+
- name: 'Install Node.js'
48+
uses: actions/setup-node@v2
3349
with:
3450
node-version: 16
3551
timeout-minutes: 5
36-
- name: Install production and development dependencies
52+
53+
# Install dependencies:
54+
- name: 'Install production and development dependencies'
3755
run: |
3856
npm install || npm install || npm install
3957
timeout-minutes: 15
40-
- name: Run benchmarks
58+
59+
# Run benchmarks:
60+
- name: 'Run benchmarks'
4161
run: |
4262
npm run benchmark

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_cancel.yml.txt

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,30 @@ name: cancel
2121

2222
# Workflow triggers:
2323
on:
24+
# Allow the workflow to be manually run:
2425
workflow_dispatch:
2526

2627
# Workflow jobs:
2728
jobs:
29+
30+
# Define a job to cancel existing workflow runs:
2831
cancel:
29-
runs-on: ubuntu-latest
32+
33+
# Define a display name:
34+
name: 'Cancel Workflow Runs'
35+
36+
# Define the type of virtual host machine:
37+
runs-on: 'ubuntu-latest'
38+
39+
# Time limit:
3040
timeout-minutes: 3
41+
42+
# Define the sequence of job steps...
3143
steps:
32-
- uses: styfle/cancel-workflow-action@0.9.0
44+
45+
# Cancel existing workflow runs:
46+
- name: 'Cancel existing workflow runs'
47+
uses: styfle/cancel-workflow-action@0.9.0
3348
with:
3449
workflow_id: >-
3550
benchmark.yml,

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_examples.yml.txt

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,42 @@ name: examples
2121

2222
# Workflow triggers:
2323
on:
24+
# Allow the workflow to be manually run:
2425
workflow_dispatch:
2526

2627
# Workflow jobs:
2728
jobs:
29+
30+
# Define a job to run the package examples...
2831
examples:
32+
33+
# Define display name:
34+
name: 'Run Examples'
35+
36+
# Define the type of virtual host machine on which to run the job:
2937
runs-on: ubuntu-latest
38+
39+
# Define the sequence of job steps...
3040
steps:
31-
- uses: actions/checkout@v3
32-
- uses: actions/setup-node@v2
41+
42+
# Checkout the repository:
43+
- name: 'Checkout the repository'
44+
uses: actions/checkout@v3
45+
46+
# Install Node.js
47+
- name: 'Install Node.js'
48+
uses: actions/setup-node@v2
3349
with:
3450
node-version: 16
3551
timeout-minutes: 5
36-
- name: Install production and development dependencies
52+
53+
# Install dependencies:
54+
- name: 'Install production and development dependencies'
3755
run: |
3856
npm install || npm install || npm install
3957
timeout-minutes: 15
40-
- name: Run examples
58+
59+
# Run examples:
60+
- name: 'Run examples'
4161
run: |
4262
npm run examples

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_test.yml.txt

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,39 +21,69 @@ name: test
2121

2222
# Workflow triggers:
2323
on:
24+
# Run workflow on a weekly schedule:
2425
schedule:
2526
# * is a special character in YAML so you have to quote this string
2627
- cron: '30 1 * * 6'
28+
29+
# Allow the workflow to be manually run:
2730
workflow_dispatch:
31+
32+
# Run workflow on each push:
2833
push:
2934

3035
# Workflow jobs:
3136
jobs:
37+
38+
# Define job to run tests...
3239
test:
33-
runs-on: ubuntu-latest
40+
41+
# Define display name:
42+
name: 'Run tests'
43+
44+
# Define the type of virtual host machine:
45+
runs-on: 'ubuntu-latest'
46+
47+
# Define environment variables:
3448
env:
3549
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
50+
51+
# Define the sequence of job steps...
3652
steps:
37-
- uses: actions/checkout@v3
38-
- uses: actions/setup-node@v2
53+
54+
# Checkout the repository:
55+
- name: 'Checkout repository'
56+
uses: actions/checkout@v3
57+
58+
# Install Node.js
59+
- name: 'Install Node.js'
60+
uses: actions/setup-node@v2
3961
with:
4062
node-version: 16
4163
timeout-minutes: 5
42-
- name: Install production and development dependencies
64+
65+
# Install dependencies:
66+
- name: 'Install production and development dependencies'
4367
id: install
4468
run: |
4569
npm install || npm install || npm install
4670
timeout-minutes: 15
47-
- name: Build native add-on (if present)
71+
72+
# Build native add-on if present
73+
- name: 'Build native add-on (if present)'
4874
run: |
4975
if [ -f "binding.gyp" ]; then
5076
npm install node-gyp --no-save && ./node_modules/.bin/node-gyp rebuild
5177
fi
52-
- name: Run tests
78+
79+
# Run tests:
80+
- name: 'Run tests'
5381
id: tests
5482
run: |
5583
npm test || npm test || npm test
56-
- name: Send status to Slack channel in case of failure
84+
85+
# Send status to Slack channel if job fails:
86+
- name: 'Send status to Slack channel in case of failure'
5787
uses: act10ns/slack@v1
5888
with:
5989
status: ${{ job.status }}

lib/node_modules/@stdlib/_tools/scripts/templates/workflow_test_bundles.yml.txt

Lines changed: 71 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,76 +21,135 @@ name: test_bundles
2121

2222
# Workflow triggers:
2323
on:
24+
# Run workflow upon completion of `bundle` workflow run:
2425
workflow_run:
2526
workflows: ["bundle"]
2627
types: [completed]
28+
29+
# Allow workflow to be manually run:
2730
workflow_dispatch:
2831

2932
# Workflow jobs:
3033
jobs:
34+
35+
# Define job to test UMD bundles...
3136
test-umd:
37+
38+
# Define display name:
39+
name: 'Test UMD Bundles'
40+
41+
# Define the type of virtual host machine on which to run the job:
3242
runs-on: ubuntu-latest
43+
44+
# Define environment variables:
3345
env:
3446
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
47+
48+
# Define the sequence of job steps...
3549
steps:
36-
- name: Checkout branch with UMD build
50+
# Checkout UMD branch of the repository:
51+
- name: 'Checkout branch with UMD build'
3752
uses: actions/checkout@v3
3853
with:
3954
ref: umd
40-
- name: Setup Node.js
55+
56+
# Install Node.js
57+
- name: 'Install Node.js'
4158
uses: actions/setup-node@v2
4259
with:
4360
node-version: 17
44-
- name: Try loading UMD module
61+
62+
# Try loading the UMD bundle:
63+
- name: 'Try loading UMD bundle'
4564
run: |
4665
node --eval "require( './bundle.js' )" || exit $?
47-
- name: Send status to Slack channel in case of failure
66+
67+
# Send notification to Slack channel if job fails:
68+
- name: 'Send status to Slack channel in case of failure'
4869
uses: act10ns/slack@v1
4970
with:
5071
status: ${{ job.status }}
5172
steps: ${{ toJson(steps) }}
5273
channel: '#npm-ci'
5374
if: failure()
75+
76+
# Define job to test ES modules...
5477
test-esm:
78+
79+
# Define display name:
80+
name: 'Test ES Modules'
81+
82+
# Define the type of virtual host machine on which to run the job:
5583
runs-on: ubuntu-latest
84+
85+
# Define environment variables:
5686
env:
5787
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
88+
89+
# Define the sequence of job steps...
5890
steps:
59-
- name: Checkout branch with ESM build
91+
92+
# Checkout ES modules branch of the repository:
93+
- name: 'Checkout branch with ESM build'
6094
uses: actions/checkout@v3
6195
with:
6296
ref: esm
63-
- name: Setup Node.js
97+
98+
# Install Node.js
99+
- name: 'Install Node.js'
64100
uses: actions/setup-node@v2
65101
with:
66102
node-version: 17
67-
- name: Try loading ESM
103+
104+
# Try loading the ES module bundle:
105+
- name: 'Try loading ESM'
68106
run: |
69107
node --experimental-network-imports --eval "import( './index.mjs' )" || exit $?
70-
- name: Send status to Slack channel in case of failure
108+
109+
# Send notification to Slack channel if job fails:
110+
- name: 'Send status to Slack channel in case of failure'
71111
uses: act10ns/slack@v1
72112
with:
73113
status: ${{ job.status }}
74114
steps: ${{ toJson(steps) }}
75115
channel: '#npm-ci'
76116
if: failure()
117+
118+
# Define job to test Deno bundles...
77119
test-deno:
120+
121+
# Define display name:
122+
name: 'Test Deno Bundles'
123+
124+
# Define the type of virtual host machine on which to run the job:
78125
runs-on: ubuntu-latest
126+
127+
# Define environment variables:
79128
env:
80129
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
130+
131+
# Define the sequence of job steps...
81132
steps:
82-
- name: Checkout branch with Deno build
133+
134+
# Checkout Deno branch of the repository:
135+
- name: 'Checkout branch with Deno build'
83136
uses: actions/checkout@v3
84137
with:
85138
ref: deno
86-
- name: Install Deno
139+
140+
# Install Deno
141+
- name: 'Install Deno'
87142
uses: denoland/setup-deno@v1
88143
with:
89144
deno-version: vx.x.x
90-
- name: Try loading Deno build
145+
146+
# Try loading the Deno bundle:
147+
- name: 'Try loading Deno build'
91148
run: |
92149
deno eval "import main from './mod.js'" || exit $?
93-
- name: Send status to Slack channel in case of failure
150+
151+
# Send notification to Slack channel if job fails:
152+
- name: 'Send status to Slack channel in case of failure'
94153
uses: act10ns/slack@v1
95154
with:
96155
status: ${{ job.status }}

0 commit comments

Comments
 (0)