Skip to content

Commit

Permalink
Auto merge of rust-lang#113791 - lnicola:sync-from-ra, r=lnicola
Browse files Browse the repository at this point in the history
⬆️ `rust-analyzer`

r? `@ghost`
  • Loading branch information
bors committed Jul 17, 2023
2 parents 1a8d094 + d35f6c6 commit b3c7a7e
Show file tree
Hide file tree
Showing 311 changed files with 15,035 additions and 10,445 deletions.
13 changes: 5 additions & 8 deletions src/tools/rust-analyzer/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ trim_trailing_whitespace = true
end_of_line = lf
insert_final_newline = true
indent_style = space

[*.{rs,toml}]
indent_size = 4

[*.ts]
indent_size = 4
[*.js]
indent_size = 4
[*.json]
indent_size = 4
[*.md]
indent_size = 2

[*.{yml, yaml}]
indent_size = 2
2 changes: 1 addition & 1 deletion src/tools/rust-analyzer/.github/workflows/autopublish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ jobs:
cargo workspaces rename --from project-model project_model
cargo workspaces rename --from test-utils test_utils
cargo workspaces rename --from text-edit text_edit
cargo workspaces rename ra_ap_%n
# Remove library crates from the workspaces so we don't auto-publish them as well
sed -i 's/ "lib\/\*",//' ./Cargo.toml
cargo workspaces rename ra_ap_%n
find crates/rust-analyzer -type f -name '*.rs' -exec sed -i 's/rust_analyzer/ra_ap_rust_analyzer/g' {} +
cargo workspaces publish --yes --force '*' --exact --no-git-commit --allow-dirty --skip-published custom 0.0.$(($RUN_NUMBER + 133))
145 changes: 130 additions & 15 deletions src/tools/rust-analyzer/.github/workflows/metrics.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: metrics
on:
push:
branches:
- master
branches:
- master

env:
CARGO_INCREMENTAL: 0
Expand All @@ -11,20 +11,135 @@ env:
RUSTUP_MAX_RETRIES: 10

jobs:
metrics:
setup_cargo:
if: github.repository == 'rust-lang/rust-analyzer'
runs-on: ubuntu-latest
steps:
- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup component add rustfmt rust-src
rustup default stable
- name: Cache cargo
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ github.sha }}

build_metrics:
runs-on: ubuntu-latest
needs: setup_cargo

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Restore cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ github.sha }}

- name: Collect build metrics
run: cargo xtask metrics build

- name: Cache target
uses: actions/cache@v3
with:
path: target/
key: ${{ runner.os }}-target-${{ github.sha }}

- name: Upload build metrics
uses: actions/upload-artifact@v3
with:
name: build-${{ github.sha }}
path: target/build.json
if-no-files-found: error

other_metrics:
strategy:
matrix:
names: [self, ripgrep, webrender, diesel]
runs-on: ubuntu-latest
needs: [setup_cargo, build_metrics]

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Restore cargo cache
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
key: ${{ runner.os }}-cargo-${{ github.sha }}

- name: Restore target cache
uses: actions/cache@v3
with:
path: target/
key: ${{ runner.os }}-target-${{ github.sha }}

- name: Collect metrics
run: cargo xtask metrics ${{ matrix.names }}

- name: Upload metrics
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.names }}-${{ github.sha }}
path: target/${{ matrix.names }}.json
if-no-files-found: error

generate_final_metrics:
runs-on: ubuntu-latest
needs: [build_metrics, other_metrics]
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Install Rust toolchain
run: |
rustup update --no-self-update stable
rustup component add rustfmt rust-src
- name: Collect metrics
run: cargo xtask metrics
env:
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
- name: Checkout repository
uses: actions/checkout@v3

- name: Download build metrics
uses: actions/download-artifact@v3
with:
name: build-${{ github.sha }}

- name: Download self metrics
uses: actions/download-artifact@v3
with:
name: self-${{ github.sha }}

- name: Download ripgrep metrics
uses: actions/download-artifact@v3
with:
name: ripgrep-${{ github.sha }}

- name: Download webrender metrics
uses: actions/download-artifact@v3
with:
name: webrender-${{ github.sha }}

- name: Download diesel metrics
uses: actions/download-artifact@v3
with:
name: diesel-${{ github.sha }}

- name: Combine json
run: |
git clone --depth 1 https://$METRICS_TOKEN@github.com/rust-analyzer/metrics.git
jq -s ".[0] * .[1] * .[2] * .[3] * .[4]" build.json self.json ripgrep.json webrender.json diesel.json -c >> metrics/metrics.json
cd metrics
git add .
git -c user.name=Bot -c user.email=dummy@example.com commit --message 📈
git push origin master
env:
METRICS_TOKEN: ${{ secrets.METRICS_TOKEN }}
Loading

0 comments on commit b3c7a7e

Please sign in to comment.