Skip to content

Commit cb5c6cd

Browse files
committed
Merge branch 'master' into basic-test-explorer
2 parents ac6dd33 + 75ac37f commit cb5c6cd

File tree

337 files changed

+17036
-10128
lines changed

Some content is hidden

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

337 files changed

+17036
-10128
lines changed

.github/workflows/autopublish.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Publish Crates
2929
env:
3030
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
31-
PATCH: ${{ github.run_number }}
31+
RUN_NUMBER: ${{ github.run_number }}
3232
shell: bash
3333
run: |
3434
git config --global user.email "[email protected]"
@@ -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' {} +
56-
cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$PATCH
56+
cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$(($RUN_NUMBER + 133))

.github/workflows/ci.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
pull-requests: read
2525
outputs:
2626
typescript: ${{ steps.filter.outputs.typescript }}
27+
proc_macros: ${{ steps.filter.outputs.proc_macros }}
2728
steps:
2829
- uses: actions/checkout@v3
2930
- uses: dorny/paths-filter@4067d885736b84de7c414f582ac45897079b0a78
@@ -45,8 +46,8 @@ jobs:
4546
runs-on: ${{ matrix.os }}
4647
env:
4748
CC: deny_c
48-
RUST_CHANNEL: "${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable'}}"
49-
USE_SYSROOT_ABI: "${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || ''}}"
49+
RUST_CHANNEL: "${{ needs.changes.outputs.proc_macros == 'true' && 'nightly' || 'stable' }}"
50+
USE_SYSROOT_ABI: "${{ needs.changes.outputs.proc_macros == 'true' && '--features sysroot-abi' || '' }}"
5051

5152
strategy:
5253
fail-fast: false
@@ -62,7 +63,8 @@ jobs:
6263
- name: Install Rust toolchain
6364
run: |
6465
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
65-
rustup component add rustfmt rust-src
66+
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
67+
rustup default ${{ env.RUST_CHANNEL }}
6668
6769
- name: Cache Dependencies
6870
uses: Swatinem/rust-cache@988c164c3d0e93c4dbab36aaf5bbeb77425b2894

.github/workflows/metrics.yaml

Lines changed: 123 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
- name: Cache cargo
23+
uses: actions/cache@v3
24+
with:
25+
path: |
26+
~/.cargo/bin/
27+
~/.cargo/registry/index/
28+
~/.cargo/registry/cache/
29+
~/.cargo/git/db/
30+
key: ${{ runner.os }}-cargo-${{ github.sha }}
31+
32+
build_metrics:
33+
runs-on: ubuntu-latest
34+
needs: setup_cargo
1735

1836
steps:
1937
- name: Checkout repository
2038
uses: actions/checkout@v3
2139

22-
- name: Install Rust toolchain
23-
run: |
24-
rustup update --no-self-update stable
25-
rustup component add rustfmt rust-src
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
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 }}
2693

2794
- name: Collect metrics
28-
run: cargo xtask metrics
29-
env:
30-
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
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]
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
144+
env:
145+
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}

0 commit comments

Comments
 (0)