Skip to content

Commit 242fa3c

Browse files
bors[bot]Swatinem
andauthored
Merge #8427
8427: Move CI to rust-cache Action r=matklad a=Swatinem This is humbling. I actually took inspiration from RAs pre-cache xtask when developing my action ;-) Closes #7731 Co-authored-by: Arpad Borsos <swatinem@swatinem.de>
2 parents eb741e8 + 3ce59b9 commit 242fa3c

File tree

4 files changed

+4
-117
lines changed

4 files changed

+4
-117
lines changed

.github/workflows/ci.yaml

Lines changed: 4 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,6 @@ jobs:
4242
if: matrix.os == 'windows-latest'
4343
run: Rename-Item C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc C:\Users\runneradmin\.rustup\toolchains\stable-x86_64-pc-windows-msvc.old
4444

45-
# Work around https://github.com/actions/cache/issues/403 by using GNU tar
46-
# instead of BSD tar.
47-
- name: Install GNU tar
48-
if: matrix.os == 'macos-latest'
49-
run: |
50-
brew install gnu-tar
51-
echo PATH="/usr/local/opt/gnu-tar/libexec/gnubin:$PATH" >> $GITHUB_ENV
52-
5345
- name: Install Rust toolchain
5446
uses: actions-rs/toolchain@v1
5547
with:
@@ -58,29 +50,15 @@ jobs:
5850
override: true
5951
components: rustfmt, rust-src
6052

61-
- name: Cache cargo directories
62-
uses: actions/cache@v2
63-
with:
64-
path: |
65-
~/.cargo/registry
66-
~/.cargo/git
67-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
68-
69-
- name: Cache cargo target dir
70-
uses: actions/cache@v2
71-
with:
72-
path: target
73-
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
53+
- name: Cache Dependencies
54+
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
7455

7556
- name: Compile
7657
run: cargo test --no-run --locked
7758

7859
- name: Test
7960
run: cargo test -- --nocapture
8061

81-
- name: Prepare cache
82-
run: cargo xtask pre-cache
83-
8462
# Weird targets to catch non-portable code
8563
rust-cross:
8664
name: Rust Cross
@@ -103,13 +81,8 @@ jobs:
10381
- name: Install Rust targets
10482
run: rustup target add ${{ env.targets }}
10583

106-
- name: Cache cargo directories
107-
uses: actions/cache@v2
108-
with:
109-
path: |
110-
~/.cargo/registry
111-
~/.cargo/git
112-
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
84+
- name: Cache Dependencies
85+
uses: Swatinem/rust-cache@ce325b60658c1b38465c06cc965b79baf32c1e72
11386

11487
- name: Check
11588
run: |

xtask/src/flags.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ xflags::xflags! {
2828
}
2929

3030
cmd fuzz-tests {}
31-
cmd pre-cache {}
3231

3332
cmd release {
3433
optional --dry-run
@@ -62,7 +61,6 @@ pub enum XtaskCmd {
6261
Help(Help),
6362
Install(Install),
6463
FuzzTests(FuzzTests),
65-
PreCache(PreCache),
6664
Release(Release),
6765
Promote(Promote),
6866
Dist(Dist),
@@ -87,9 +85,6 @@ pub struct Install {
8785
#[derive(Debug)]
8886
pub struct FuzzTests;
8987

90-
#[derive(Debug)]
91-
pub struct PreCache;
92-
9388
#[derive(Debug)]
9489
pub struct Release {
9590
pub dry_run: bool,

xtask/src/main.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ mod install;
1818
mod release;
1919
mod dist;
2020
mod metrics;
21-
mod pre_cache;
2221

2322
use anyhow::{bail, Result};
2423
use std::{
@@ -39,7 +38,6 @@ fn main() -> Result<()> {
3938
}
4039
flags::XtaskCmd::Install(cmd) => cmd.run(),
4140
flags::XtaskCmd::FuzzTests(_) => run_fuzzer(),
42-
flags::XtaskCmd::PreCache(cmd) => cmd.run(),
4341
flags::XtaskCmd::Release(cmd) => cmd.run(),
4442
flags::XtaskCmd::Promote(cmd) => cmd.run(),
4543
flags::XtaskCmd::Dist(cmd) => cmd.run(),

xtask/src/pre_cache.rs

Lines changed: 0 additions & 79 deletions
This file was deleted.

0 commit comments

Comments
 (0)