-
-
Notifications
You must be signed in to change notification settings - Fork 9
170 lines (161 loc) · 5.87 KB
/
Copy pathbench.yml
File metadata and controls
170 lines (161 loc) · 5.87 KB
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
name: Run benchmark and commit results
permissions:
contents: write
on:
push:
branches: ["main"]
paths:
- "bench/**"
- "schemas/**"
workflow_dispatch:
concurrency:
group: bench-main-${{ github.ref }}
cancel-in-progress: true
jobs:
build-schemas:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Setup environment
uses: ./.github/actions/environments/cached
with:
cache-prefix: bench
- name: Build schemas
shell: bash
env:
TTSC_CACHE_DIR: ${{ github.workspace }}/.ttsc-cache
run: pnpm schemas:build
- name: Save ttsc native cache
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ttsc-cache
key: ${{ runner.os }}-ttsc-native-bench-${{ hashFiles('pnpm-lock.yaml', '**/go.mod', '**/go.sum') }}
- name: Upload schemas
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: schemas-build
path: schemas/dist/
retention-days: 1
bench-stack:
needs: build-schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download schemas
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: schemas-build
path: schemas/dist/
- name: Setup environment
uses: ./.github/actions/environments
- name: Run stack benchmark
run: pnpm bench:stack
- name: Upload stack results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: stack-results
path: bench/stack.json
bench-download:
needs: build-schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download schemas
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: schemas-build
path: schemas/dist/
- name: Setup environment
uses: ./.github/actions/environments/cached
with:
cache-prefix: bench
- name: Run download benchmark
env:
TTSC_CACHE_DIR: ${{ github.workspace }}/.ttsc-cache
run: pnpm bench:download
- name: Save ttsc native cache
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ${{ github.workspace }}/.ttsc-cache
key: ${{ runner.os }}-ttsc-native-bench-${{ hashFiles('pnpm-lock.yaml', '**/go.mod', '**/go.sum') }}
- name: Upload download results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: download-results
path: |
bench/download.json
schemas/libraries/**/download_compiled/**
bench-bench:
needs: build-schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download schemas
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: schemas-build
path: schemas/dist/
- name: Setup environment
uses: ./.github/actions/environments
- name: Run bench benchmark
run: pnpm bench:bench
- name: Upload bench results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: bench-results
path: bench/bench.json
bench-json-schema:
needs: build-schemas
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Download schemas
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: schemas-build
path: schemas/dist/
- name: Setup environment
uses: ./.github/actions/environments
- name: Run JSON schema benchmark
run: pnpm bench:json-schema
- name: Upload JSON schema results
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: json-schema-results
path: bench/json-schema.json
collect-results:
needs: [bench-stack, bench-download, bench-bench, bench-json-schema]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- parallel:
- name: Download bench results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: bench-results
path: bench
- name: Download stack results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: stack-results
path: bench
- name: Download download results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: download-results
path: .
- name: Download JSON schema results
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
with:
name: json-schema-results
path: bench
- name: Derive short commit SHA
env:
SOURCE_SHA: ${{ github.sha }}
run: echo "SHORT_SHA=${SOURCE_SHA::7}" >> "$GITHUB_ENV"
- name: Commit & Push changes
uses: actions-js/push@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: main
message: "Update bench results (${{ env.SHORT_SHA }})"