| 1 | name: json encoder benchmark CI |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | paths: |
| 6 | - 'vlib/x/json2/**' # Trigger on changes in this folder |
| 7 | - '!vlib/x/json2/strict/**' # Ignore |
| 8 | - '!vlib/x/json2/tests/**' # Ignore |
| 9 | |
| 10 | jobs: |
| 11 | json-encode-benchmark: |
| 12 | runs-on: ubuntu-latest |
| 13 | timeout-minutes: 5 |
| 14 | |
| 15 | steps: |
| 16 | - name: Checkout repository |
| 17 | uses: actions/checkout@v6 |
| 18 | |
| 19 | - name: Build V |
| 20 | run: make -j4 && ./v symlink |
| 21 | |
| 22 | - name: Run V benchmark and save output |
| 23 | run: (echo '```sh'; v -prod crun vlib/v/tests/bench/bench_json_vs_json2.v; echo '```') > vlib/v/tests/bench/bench_json_vs_json2_out.md |
| 24 | |
| 25 | - name: Upload result file |
| 26 | uses: actions/upload-artifact@v7 |
| 27 | with: |
| 28 | name: program-output |
| 29 | path: vlib/v/tests/bench/bench_json_vs_json2_out.md |
| 30 | |