|
9 | 9 | # performance analysis in order to generate initial data. |
10 | 10 | workflow_dispatch: |
11 | 11 |
|
12 | | -permissions: |
13 | | - contents: read |
14 | | - id-token: write |
| 12 | +permissions: {} |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 16 | + cancel-in-progress: true |
15 | 17 |
|
16 | 18 | jobs: |
17 | | - benchmarks: |
18 | | - name: Run benchmarks |
| 19 | + build: |
| 20 | + name: Build |
19 | 21 | runs-on: ubuntu-latest |
20 | | - |
| 22 | + permissions: |
| 23 | + contents: read # clone repo |
21 | 24 | steps: |
22 | 25 | - name: Checkout |
23 | | - uses: actions/checkout@v4 |
| 26 | + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 |
24 | 27 | with: |
25 | 28 | submodules: true |
| 29 | + persist-credentials: false |
26 | 30 |
|
27 | 31 | - name: Setup Deno |
28 | | - uses: denoland/setup-deno@v2 |
| 32 | + uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 |
29 | 33 | with: |
30 | 34 | deno-version: v2.x |
31 | 35 |
|
32 | | - - name: Setup Node |
33 | | - uses: actions/setup-node@v4 |
| 36 | + - name: Cache WASM |
| 37 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 38 | + id: wasm-cache |
34 | 39 | with: |
35 | | - node-version: 22 |
| 40 | + path: | |
| 41 | + clayterm.wasm |
| 42 | + wasm.ts |
| 43 | + key: wasm-${{ hashFiles('Makefile', 'src/**', 'tasks/bundle-wasm.ts') }} |
36 | 44 |
|
37 | 45 | - name: Build WASM |
| 46 | + if: steps.wasm-cache.outputs.cache-hit != 'true' |
38 | 47 | run: make |
39 | 48 |
|
| 49 | + - name: Cache dependencies |
| 50 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 51 | + id: deno-cache |
| 52 | + with: |
| 53 | + path: node_modules |
| 54 | + key: deno-${{ hashFiles('deno.lock') }} |
| 55 | + |
| 56 | + - name: Install dependencies |
| 57 | + if: steps.deno-cache.outputs.cache-hit != 'true' |
| 58 | + run: deno install |
| 59 | + |
| 60 | + - name: Upload build artifact |
| 61 | + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 |
| 62 | + with: |
| 63 | + name: bench-build |
| 64 | + retention-days: 1 |
| 65 | + path: wasm.ts |
| 66 | + |
| 67 | + simulation: |
| 68 | + name: Run benchmarks (simulation) |
| 69 | + needs: build |
| 70 | + runs-on: ubuntu-latest |
| 71 | + permissions: |
| 72 | + contents: read # clone repo |
| 73 | + id-token: write # upload benchmark results to codspeed |
| 74 | + |
| 75 | + steps: |
| 76 | + - name: Checkout |
| 77 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 |
| 78 | + |
| 79 | + - name: Setup Deno |
| 80 | + uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 |
| 81 | + with: |
| 82 | + deno-version: v2.x |
| 83 | + |
| 84 | + - name: Setup Node |
| 85 | + uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 |
| 86 | + with: |
| 87 | + node-version: 24 |
| 88 | + |
| 89 | + - name: Download build artifact |
| 90 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 91 | + with: |
| 92 | + name: bench-build |
| 93 | + |
| 94 | + - name: Restore dependencies |
| 95 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 96 | + id: deno-cache |
| 97 | + with: |
| 98 | + path: node_modules |
| 99 | + key: deno-${{ hashFiles('deno.lock') }} |
| 100 | + |
40 | 101 | - name: Install dependencies |
| 102 | + if: steps.deno-cache.outputs.cache-hit != 'true' |
41 | 103 | run: deno install |
42 | 104 |
|
43 | 105 | - name: Run benchmarks |
44 | | - uses: CodSpeedHQ/action@v4 |
| 106 | + uses: CodSpeedHQ/action@9d332c4d90b43981c3e55ae8e38e68709996240f # v4.17.0 |
45 | 107 | with: |
46 | 108 | mode: simulation |
47 | 109 | # IMPORTANT! deno task bench fails in CI due to incompatible V8 bindings |
48 | 110 | run: node bench/mod.ts |
| 111 | + |
| 112 | + walltime: |
| 113 | + name: Run benchmarks (walltime) |
| 114 | + needs: build |
| 115 | + runs-on: codspeed-macro |
| 116 | + permissions: |
| 117 | + contents: read # clone repo |
| 118 | + id-token: write # upload benchmark results to codspeed |
| 119 | + |
| 120 | + steps: |
| 121 | + - name: Checkout |
| 122 | + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1 |
| 123 | + |
| 124 | + - name: Setup Deno |
| 125 | + uses: denoland/setup-deno@667a34cdef165d8d2b2e98dde39547c9daac7282 # v2.0.4 |
| 126 | + with: |
| 127 | + deno-version: v2.x |
| 128 | + |
| 129 | + - name: Setup Node |
| 130 | + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 |
| 131 | + with: |
| 132 | + node-version: 24 |
| 133 | + |
| 134 | + - name: Download build artifact |
| 135 | + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 |
| 136 | + with: |
| 137 | + name: bench-build |
| 138 | + |
| 139 | + - name: Restore dependencies |
| 140 | + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 141 | + id: deno-cache |
| 142 | + with: |
| 143 | + path: node_modules |
| 144 | + key: deno-codspeed-${{ runner.arch }}-${{ hashFiles('deno.lock') }} |
| 145 | + |
| 146 | + - name: Install dependencies |
| 147 | + if: steps.deno-cache.outputs.cache-hit != 'true' |
| 148 | + run: deno install |
| 149 | + |
| 150 | + - name: Run process startup benchmarks |
| 151 | + uses: CodSpeedHQ/action@9d332c4d90b43981c3e55ae8e38e68709996240f # v4.17.0 |
| 152 | + with: |
| 153 | + mode: walltime |
| 154 | + run: node bench/startup.bench.ts |
0 commit comments