Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document directories for caching in CI #9581

Closed
xenoterracide opened this issue Jun 13, 2021 · 2 comments
Closed

Document directories for caching in CI #9581

xenoterracide opened this issue Jun 13, 2021 · 2 comments

Comments

@xenoterracide
Copy link

xenoterracide commented Jun 13, 2021

I was reading the CI documentation https://doc.rust-lang.org/cargo/guide/continuous-integration.html

and I was unable to find what directories I should be able to cache, specifically I was interested in the ones that contain dependencies. I've come up with this, and am using github CI, but I don't need documentation for every CI system out there, just documentation for what directories to/can be safely cached.

on:
  push:
    paths:
    - '**.rs'
    - '**.toml'
    - Cargo.lock
    - .github/**
name: build
jobs:
  check:
    name: Rust project
    runs-on: ubuntu-latest
    env:
      CARGO_TERM_COLOR: always
    steps:
    - uses: actions/checkout@v2
    - uses: actions-rs/toolchain@v1
      id: rust-toolchain
      with:
        toolchain: stable
        profile: minimal
        components: rustfmt, clippy
    - uses: actions/cache@v2
      with:
        path: |
          ~/.cargo
          target/debug/deps
          target/debug/build
        key: ${{ steps.rust-toolchain.outputs.rustc_hash }}-${{hashFiles('Cargo.lock')}}
    - run: cargo fmt --all -- --check
    - run: cargo check --all
    - run: cargo clippy --all
    - run: cargo build --all
    - run: cargo test --all
@ehuss
Copy link
Contributor

ehuss commented Jul 2, 2021

Thanks for the report! Yea, it is unfortunately not well documented. I suspect your example might have issues, since it is missing things like the fingerprints.

I'm going to close this as a duplicate of #7757 (and also #5656 and #8841).

@ehuss ehuss closed this as completed Jul 2, 2021
@xenoterracide
Copy link
Author

I never said mine was a good configuration, hence the need for documentation ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants