Skip to content

Commit b3c7a7e

Browse files
committed
Auto merge of #113791 - lnicola:sync-from-ra, r=lnicola
⬆️ `rust-analyzer` r? `@ghost`
2 parents 1a8d094 + d35f6c6 commit b3c7a7e

File tree

311 files changed

+15035
-10445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

311 files changed

+15035
-10445
lines changed

src/tools/rust-analyzer/.editorconfig

+5-8
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,10 @@ trim_trailing_whitespace = true
77
end_of_line = lf
88
insert_final_newline = true
99
indent_style = space
10-
11-
[*.{rs,toml}]
1210
indent_size = 4
1311

14-
[*.ts]
15-
indent_size = 4
16-
[*.js]
17-
indent_size = 4
18-
[*.json]
19-
indent_size = 4
12+
[*.md]
13+
indent_size = 2
14+
15+
[*.{yml, yaml}]
16+
indent_size = 2

src/tools/rust-analyzer/.github/workflows/autopublish.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ jobs:
4949
cargo workspaces rename --from project-model project_model
5050
cargo workspaces rename --from test-utils test_utils
5151
cargo workspaces rename --from text-edit text_edit
52-
cargo workspaces rename ra_ap_%n
5352
# Remove library crates from the workspaces so we don't auto-publish them as well
5453
sed -i 's/ "lib\/\*",//' ./Cargo.toml
54+
cargo workspaces rename ra_ap_%n
5555
find crates/rust-analyzer -type f -name '*.rs' -exec sed -i 's/rust_analyzer/ra_ap_rust_analyzer/g' {} +
5656
cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$(($RUN_NUMBER + 133))
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
name: metrics
22
on:
33
push:
4-
branches:
5-
- master
4+
branches:
5+
- master
66

77
env:
88
CARGO_INCREMENTAL: 0
@@ -11,20 +11,135 @@ env:
1111
RUSTUP_MAX_RETRIES: 10
1212

1313
jobs:
14-
metrics:
14+
setup_cargo:
1515
if: github.repository == 'rust-lang/rust-analyzer'
1616
runs-on: ubuntu-latest
17+
steps:
18+
- name: Install Rust toolchain
19+
run: |
20+
rustup update --no-self-update stable
21+
rustup component add rustfmt rust-src
22+
rustup default stable
23+
- name: Cache cargo
24+
uses: actions/cache@v3
25+
with:
26+
path: |
27+
~/.cargo/bin/
28+
~/.cargo/registry/index/
29+
~/.cargo/registry/cache/
30+
~/.cargo/git/db/
31+
key: ${{ runner.os }}-cargo-${{ github.sha }}
32+
33+
build_metrics:
34+
runs-on: ubuntu-latest
35+
needs: setup_cargo
36+
37+
steps:
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+
67+
other_metrics:
68+
strategy:
69+
matrix:
70+
names: [self, ripgrep, webrender, diesel]
71+
runs-on: ubuntu-latest
72+
needs: [setup_cargo, build_metrics]
73+
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 }}
1793

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+
104+
generate_final_metrics:
105+
runs-on: ubuntu-latest
106+
needs: [build_metrics, other_metrics]
18107
steps:
19-
- name: Checkout repository
20-
uses: actions/checkout@v3
21-
22-
- name: Install Rust toolchain
23-
run: |
24-
rustup update --no-self-update stable
25-
rustup component add rustfmt rust-src
26-
27-
- name: Collect metrics
28-
run: cargo xtask metrics
29-
env:
30-
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
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
144+
env:
145+
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}

0 commit comments

Comments
 (0)