11name : metrics
22on :
33 push :
4- branches :
5- - master
4+ branches :
5+ - master
66
77env :
88 CARGO_INCREMENTAL : 0
1919 run : |
2020 rustup update --no-self-update stable
2121 rustup component add rustfmt rust-src
22+ rustup default stable
2223 - name : Cache cargo
2324 uses : actions/cache@v3
2425 with :
@@ -34,35 +35,34 @@ jobs:
3435 needs : setup_cargo
3536
3637 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
6666
6767 other_metrics :
6868 strategy :
@@ -72,74 +72,74 @@ jobs:
7272 needs : [setup_cargo, build_metrics]
7373
7474 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
103103
104104 generate_final_metrics :
105105 runs-on : ubuntu-latest
106106 needs : [build_metrics, other_metrics]
107107 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://$METRICS_TOKEN@github.com/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 user.email=dummy@example.com 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://$METRICS_TOKEN@github.com/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 user.email=dummy@example.com commit --message 📈
143+ git push origin master
144144 env :
145145 METRICS_TOKEN : ${{ secrets.METRICS_TOKEN }}
0 commit comments