Skip to content

Commit

Permalink
Merge commit '37f84c101bca43b11027f30ab0c2852f9325bc3d' into sync-fro…
Browse files Browse the repository at this point in the history
…m-ra
  • Loading branch information
lnicola committed Jul 17, 2023
2 parents 6f65ef5 + 37f84c1 commit d35f6c6
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 d35f6c6

Please sign in to comment.