-
Notifications
You must be signed in to change notification settings - Fork 331
97 lines (80 loc) · 2.86 KB
/
performance-check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Gathers baseline performance data for the bundled version of Quarto
name: Performance Check
on:
workflow_dispatch:
pull_request:
branches: [main]
push:
# only trigger on branches, not on tags
branches: [main]
schedule:
- cron: 0 * * * *
jobs:
test-bundle:
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v3
with:
# checkout full tree
fetch-depth: 0
- name: Set Path
shell: bash
run: |
echo "$HOME/bin" >> $GITHUB_PATH
- name: Configure Quarto
uses: ./.github/workflows/actions/quarto-dev
- name: Test Bundle
id: create_bundle
shell: bash
run: |
# Do the bundle
pushd package/src
bundle_start=$(date +%s.%3N)
./quarto-bld prepare-dist
bundle_end=$(date +%s.%3N)
bundle_elapsed=$(printf '%.3f\n' $(echo "scale=3; $bundle_end - $bundle_start" | bc))
popd
# move the TS file so quarto command will use bundled JS
mv src/quarto.ts src/quarto1.ts
pushd package/pkg-working/bin
# test a bare quarto command
q_start=$(date +%s.%3N)
./quarto
q_end=$(date +%s.%3N)
q_elapsed=$(printf '%.3f\n' $(echo "scale=3; $q_end - $q_start" | bc))
# test a quarto render
q_render_start=$(date +%s.%3N)
./quarto render ../../../tests/docs/test.qmd --to html
q_render_end=$(date +%s.%3N)
q_render_elapsed=$(printf '%.3f\n' $(echo "scale=3; $q_render_end - $q_render_start" | bc))
popd
# return the measures
echo "bundle_time=$bundle_elapsed" >> $GITHUB_OUTPUT
echo "q_time=$q_elapsed" >> $GITHUB_OUTPUT
echo "q_render_time=$q_render_elapsed" >> $GITHUB_OUTPUT
echo "commit=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT
- name: Send Event
uses: ./.github/workflows/actions/amplitude
with:
api_key: ${{ secrets.amplitude_api_key }}
event: "Bundle"
success: true
duration: ${{ steps.create_bundle.outputs.bundle_time }}
commit: ${{ steps.create_bundle.outputs.commit }}
- name: Send Event
uses: ./.github/workflows/actions/amplitude
with:
api_key: ${{ secrets.amplitude_api_key }}
event: "Quarto"
success: true
duration: ${{ steps.create_bundle.outputs.q_time }}
commit: ${{ steps.create_bundle.outputs.commit }}
- name: Send Event
uses: ./.github/workflows/actions/amplitude
with:
api_key: ${{ secrets.amplitude_api_key }}
event: "Quarto Render"
success: true
duration: ${{ steps.create_bundle.outputs.q_render_time }}
commit: ${{ steps.create_bundle.outputs.commit }}