mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-31 23:38:45 +00:00
Auto merge of #17235 - Veykril:metrics-caching, r=Veykril
internal: Use Swatinem/rust-cache for metrics CI Current metrics caching uses a base cache action, whereas I think the one we use for general ci works here as well. Saw this while noticing that our metrics CI is broken as it for some reason uses an outdated rust stable? (unsure why that is)
This commit is contained in:
commit
6095cbf14d
2 changed files with 14 additions and 31 deletions
6
.github/workflows/ci.yaml
vendored
6
.github/workflows/ci.yaml
vendored
|
@ -63,15 +63,15 @@ jobs:
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
|
rustup update --no-self-update ${{ env.RUST_CHANNEL }}
|
||||||
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
|
|
||||||
rustup default ${{ env.RUST_CHANNEL }}
|
rustup default ${{ env.RUST_CHANNEL }}
|
||||||
|
rustup component add --toolchain ${{ env.RUST_CHANNEL }} rustfmt rust-src
|
||||||
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
|
# https://github.com/actions-rust-lang/setup-rust-toolchain/blob/main/rust.json
|
||||||
- name: Install Rust Problem Matcher
|
- name: Install Rust Problem Matcher
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: echo "::add-matcher::.github/rust.json"
|
run: echo "::add-matcher::.github/rust.json"
|
||||||
|
|
||||||
- name: Cache Dependencies
|
- name: Cache Dependencies
|
||||||
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
|
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
|
||||||
with:
|
with:
|
||||||
key: ${{ env.RUST_CHANNEL }}
|
key: ${{ env.RUST_CHANNEL }}
|
||||||
|
|
||||||
|
@ -140,7 +140,7 @@ jobs:
|
||||||
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
|
rustup target add ${{ env.targets }} ${{ env.targets_ide }}
|
||||||
|
|
||||||
- name: Cache Dependencies
|
- name: Cache Dependencies
|
||||||
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
|
uses: Swatinem/rust-cache@9bdad043e88c75890e36ad3bbc8d27f0090dd609
|
||||||
|
|
||||||
- name: Check
|
- name: Check
|
||||||
run: |
|
run: |
|
||||||
|
|
39
.github/workflows/metrics.yaml
vendored
39
.github/workflows/metrics.yaml
vendored
|
@ -18,17 +18,14 @@ jobs:
|
||||||
- name: Install Rust toolchain
|
- name: Install Rust toolchain
|
||||||
run: |
|
run: |
|
||||||
rustup update --no-self-update stable
|
rustup update --no-self-update stable
|
||||||
rustup component add rustfmt rust-src
|
|
||||||
rustup default stable
|
rustup default stable
|
||||||
|
rustup component add --toolchain stable rustfmt rust-src
|
||||||
|
|
||||||
- name: Cache cargo
|
- name: Cache cargo
|
||||||
uses: actions/cache@v4
|
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
||||||
|
cache-targets: "false"
|
||||||
|
|
||||||
build_metrics:
|
build_metrics:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -39,23 +36,19 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Restore cargo cache
|
- name: Restore cargo cache
|
||||||
uses: actions/cache@v4
|
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
||||||
|
cache-targets: "false"
|
||||||
|
|
||||||
- name: Collect build metrics
|
- name: Collect build metrics
|
||||||
run: cargo xtask metrics build
|
run: cargo xtask metrics build
|
||||||
|
|
||||||
- name: Cache target
|
- name: Cache target
|
||||||
uses: actions/cache@v4
|
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
|
||||||
with:
|
with:
|
||||||
path: target/
|
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
||||||
key: ${{ runner.os }}-target-${{ github.sha }}
|
cache-targets: "true"
|
||||||
|
|
||||||
- name: Upload build metrics
|
- name: Upload build metrics
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
|
@ -76,20 +69,10 @@ jobs:
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Restore cargo cache
|
- name: Restore cargo cache
|
||||||
uses: actions/cache@v4
|
uses: Swatinem/rust-cache@640a22190e7a783d4c409684cea558f081f92012
|
||||||
with:
|
with:
|
||||||
path: |
|
|
||||||
~/.cargo/bin/
|
|
||||||
~/.cargo/registry/index/
|
|
||||||
~/.cargo/registry/cache/
|
|
||||||
~/.cargo/git/db/
|
|
||||||
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
key: ${{ runner.os }}-cargo-${{ github.sha }}
|
||||||
|
cache-targets: "true"
|
||||||
- name: Restore target cache
|
|
||||||
uses: actions/cache@v4
|
|
||||||
with:
|
|
||||||
path: target/
|
|
||||||
key: ${{ runner.os }}-target-${{ github.sha }}
|
|
||||||
|
|
||||||
- name: Collect metrics
|
- name: Collect metrics
|
||||||
run: cargo xtask metrics "${{ matrix.names }}"
|
run: cargo xtask metrics "${{ matrix.names }}"
|
||||||
|
|
Loading…
Reference in a new issue