1
1
name : metrics
2
2
on :
3
3
push :
4
- branches :
5
- - master
4
+ branches :
5
+ - master
6
6
7
7
env :
8
8
CARGO_INCREMENTAL : 0
19
19
run : |
20
20
rustup update --no-self-update stable
21
21
rustup component add rustfmt rust-src
22
+ rustup default stable
22
23
- name : Cache cargo
23
24
uses : actions/cache@v3
24
25
with :
@@ -34,35 +35,34 @@ jobs:
34
35
needs : setup_cargo
35
36
36
37
steps :
37
- - name : Checkout repository
38
- uses : actions/checkout@v3
39
-
40
- - name : Restore cargo cache
41
- uses : actions/cache@v3
42
- with :
43
- path : |
44
- ~/.cargo/bin/
45
- ~/.cargo/registry/index/
46
- ~/.cargo/registry/cache/
47
- ~/.cargo/git/db/
48
- key : ${{ runner.os }}-cargo-${{ github.sha }}
49
-
50
-
51
- - name : Collect build metrics
52
- run : cargo xtask metrics build
53
-
54
- - name : Cache target
55
- uses : actions/cache@v3
56
- with :
57
- path : target/
58
- key : ${{ runner.os }}-target-${{ github.sha }}
59
-
60
- - name : Upload build metrics
61
- uses : actions/upload-artifact@v3
62
- with :
63
- name : build-${{ github.sha }}
64
- path : target/build.json
65
- if-no-files-found : error
38
+ - name : Checkout repository
39
+ uses : actions/checkout@v3
40
+
41
+ - name : Restore cargo cache
42
+ uses : actions/cache@v3
43
+ with :
44
+ path : |
45
+ ~/.cargo/bin/
46
+ ~/.cargo/registry/index/
47
+ ~/.cargo/registry/cache/
48
+ ~/.cargo/git/db/
49
+ key : ${{ runner.os }}-cargo-${{ github.sha }}
50
+
51
+ - name : Collect build metrics
52
+ run : cargo xtask metrics build
53
+
54
+ - name : Cache target
55
+ uses : actions/cache@v3
56
+ with :
57
+ path : target/
58
+ key : ${{ runner.os }}-target-${{ github.sha }}
59
+
60
+ - name : Upload build metrics
61
+ uses : actions/upload-artifact@v3
62
+ with :
63
+ name : build-${{ github.sha }}
64
+ path : target/build.json
65
+ if-no-files-found : error
66
66
67
67
other_metrics :
68
68
strategy :
@@ -72,74 +72,74 @@ jobs:
72
72
needs : [setup_cargo, build_metrics]
73
73
74
74
steps :
75
- - name : Checkout repository
76
- uses : actions/checkout@v3
77
-
78
- - name : Restore cargo cache
79
- uses : actions/cache@v3
80
- with :
81
- path : |
82
- ~/.cargo/bin/
83
- ~/.cargo/registry/index/
84
- ~/.cargo/registry/cache/
85
- ~/.cargo/git/db/
86
- key : ${{ runner.os }}-cargo-${{ github.sha }}
87
-
88
- - name : Restore target cache
89
- uses : actions/cache@v3
90
- with :
91
- path : target/
92
- key : ${{ runner.os }}-target-${{ github.sha }}
93
-
94
- - name : Collect metrics
95
- run : cargo xtask metrics ${{ matrix.names }}
96
-
97
- - name : Upload metrics
98
- uses : actions/upload-artifact@v3
99
- with :
100
- name : ${{ matrix.names }}-${{ github.sha }}
101
- path : target/${{ matrix.names }}.json
102
- if-no-files-found : error
75
+ - name : Checkout repository
76
+ uses : actions/checkout@v3
77
+
78
+ - name : Restore cargo cache
79
+ uses : actions/cache@v3
80
+ with :
81
+ path : |
82
+ ~/.cargo/bin/
83
+ ~/.cargo/registry/index/
84
+ ~/.cargo/registry/cache/
85
+ ~/.cargo/git/db/
86
+ key : ${{ runner.os }}-cargo-${{ github.sha }}
87
+
88
+ - name : Restore target cache
89
+ uses : actions/cache@v3
90
+ with :
91
+ path : target/
92
+ key : ${{ runner.os }}-target-${{ github.sha }}
93
+
94
+ - name : Collect metrics
95
+ run : cargo xtask metrics ${{ matrix.names }}
96
+
97
+ - name : Upload metrics
98
+ uses : actions/upload-artifact@v3
99
+ with :
100
+ name : ${{ matrix.names }}-${{ github.sha }}
101
+ path : target/${{ matrix.names }}.json
102
+ if-no-files-found : error
103
103
104
104
generate_final_metrics :
105
105
runs-on : ubuntu-latest
106
106
needs : [build_metrics, other_metrics]
107
107
steps :
108
- - name : Checkout repository
109
- uses : actions/checkout@v3
110
-
111
- - name : Download build metrics
112
- uses : actions/download-artifact@v3
113
- with :
114
- name : build-${{ github.sha }}
115
-
116
- - name : Download self metrics
117
- uses : actions/download-artifact@v3
118
- with :
119
- name : self-${{ github.sha }}
120
-
121
- - name : Download ripgrep metrics
122
- uses : actions/download-artifact@v3
123
- with :
124
- name : ripgrep-${{ github.sha }}
125
-
126
- - name : Download webrender metrics
127
- uses : actions/download-artifact@v3
128
- with :
129
- name : webrender-${{ github.sha }}
130
-
131
- - name : Download diesel metrics
132
- uses : actions/download-artifact@v3
133
- with :
134
- name : diesel-${{ github.sha }}
135
-
136
- - name : Combine json
137
- run : |
138
- git clone --depth 1 https://[email protected] /rust-analyzer/metrics.git
139
- jq -s ".[0] * .[1] * .[2] * .[3] * .[4]" build.json self.json ripgrep.json webrender.json diesel.json -c >> metrics/metrics.json
140
- cd metrics
141
- git add .
142
- git -c user.name=Bot -c [email protected] commit --message 📈
143
- git push origin master
108
+ - name : Checkout repository
109
+ uses : actions/checkout@v3
110
+
111
+ - name : Download build metrics
112
+ uses : actions/download-artifact@v3
113
+ with :
114
+ name : build-${{ github.sha }}
115
+
116
+ - name : Download self metrics
117
+ uses : actions/download-artifact@v3
118
+ with :
119
+ name : self-${{ github.sha }}
120
+
121
+ - name : Download ripgrep metrics
122
+ uses : actions/download-artifact@v3
123
+ with :
124
+ name : ripgrep-${{ github.sha }}
125
+
126
+ - name : Download webrender metrics
127
+ uses : actions/download-artifact@v3
128
+ with :
129
+ name : webrender-${{ github.sha }}
130
+
131
+ - name : Download diesel metrics
132
+ uses : actions/download-artifact@v3
133
+ with :
134
+ name : diesel-${{ github.sha }}
135
+
136
+ - name : Combine json
137
+ run : |
138
+ git clone --depth 1 https://[email protected] /rust-analyzer/metrics.git
139
+ jq -s ".[0] * .[1] * .[2] * .[3] * .[4]" build.json self.json ripgrep.json webrender.json diesel.json -c >> metrics/metrics.json
140
+ cd metrics
141
+ git add .
142
+ git -c user.name=Bot -c [email protected] commit --message 📈
143
+ git push origin master
144
144
env :
145
145
METRICS_TOKEN : ${{ secrets.METRICS_TOKEN }}
0 commit comments