|
| 1 | +#/ |
| 2 | +# @license Apache-2.0 |
| 3 | +# |
| 4 | +# Copyright (c) 2025 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: random_benchmarks |
| 21 | + |
| 22 | +# Workflow triggers: |
| 23 | +on: |
| 24 | + # Trigger the workflow every 24 hours: |
| 25 | + schedule: |
| 26 | + - cron: '0 0 * * *' |
| 27 | + |
| 28 | + # Allow the workflow to be manually run: |
| 29 | + workflow_dispatch: |
| 30 | + |
| 31 | +# Global permissions: |
| 32 | +permissions: |
| 33 | + # Allow read-only access to the repository contents: |
| 34 | + contents: read |
| 35 | + |
| 36 | +# Workflow jobs: |
| 37 | +jobs: |
| 38 | + |
| 39 | + # Define a job for running random benchmarks... |
| 40 | + process: |
| 41 | + |
| 42 | + # Define a display name: |
| 43 | + name: 'Run random benchmarks' |
| 44 | + |
| 45 | + # Ensure the job does not run on forks: |
| 46 | + if: github.repository == 'stdlib-js/stdlib' |
| 47 | + |
| 48 | + # Define the type of virtual host machine: |
| 49 | + runs-on: ubuntu-latest |
| 50 | + |
| 51 | + # Define the sequence of job steps... |
| 52 | + steps: |
| 53 | + # Checkout the repository: |
| 54 | + - name: 'Checkout repository' |
| 55 | + # Pin action to full length commit SHA |
| 56 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 57 | + with: |
| 58 | + # Specify whether to remove untracked files before checking out the repository: |
| 59 | + clean: true |
| 60 | + |
| 61 | + # Limit clone depth to the last 1000 commits: |
| 62 | + fetch-depth: 1000 |
| 63 | + |
| 64 | + # Specify whether to download Git-LFS files: |
| 65 | + lfs: false |
| 66 | + |
| 67 | + # Avoid storing GitHub token in local Git configuration: |
| 68 | + persist-credentials: false |
| 69 | + timeout-minutes: 10 |
| 70 | + |
| 71 | + # Install Node.js: |
| 72 | + - name: 'Install Node.js' |
| 73 | + # Pin action to full length commit SHA |
| 74 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 75 | + with: |
| 76 | + node-version: '18' # 'lts/*' |
| 77 | + timeout-minutes: 5 |
| 78 | + |
| 79 | + # Install dependencies (accounting for possible network failures, etc, when installing node module dependencies): |
| 80 | + - name: 'Install dependencies' |
| 81 | + run: | |
| 82 | + make install-node-modules || make install-node-modules || make install-node-modules |
| 83 | + timeout-minutes: 15 |
| 84 | + |
| 85 | + # Run JavaScript and native add-on benchmarks: |
| 86 | + - name: 'Run JavaScript and native add-on benchmarks' |
| 87 | + run: | |
| 88 | + make benchmarks-random-javascript RANDOM_SELECTION_SIZE=50 BUILD_ADDONS=1 |
| 89 | + timeout-minutes: 60 |
| 90 | + |
| 91 | + # Run C benchmarks: |
| 92 | + - name: 'Run C benchmarks' |
| 93 | + run: | |
| 94 | + make benchmarks-random-c RANDOM_SELECTION_SIZE=10 |
| 95 | + timeout-minutes: 60 |
0 commit comments