Skip to content

Commit 9c022e3

Browse files
committed
Move CI to rust-cache Action
1 parent 94d9fc2 commit 9c022e3

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@v1
7455

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

7859
- name: Test
7960
run: cargo test
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@v1
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
@@ -63,7 +62,6 @@ pub enum XtaskCmd {
6362
Help(Help),
6463
Install(Install),
6564
FuzzTests(FuzzTests),
66-
PreCache(PreCache),
6765
Release(Release),
6866
Promote(Promote),
6967
Dist(Dist),
@@ -91,9 +89,6 @@ pub struct Lint;
9189
#[derive(Debug)]
9290
pub struct FuzzTests;
9391

94-
#[derive(Debug)]
95-
pub struct PreCache;
96-
9792
#[derive(Debug)]
9893
pub struct Release {
9994
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::{
@@ -41,7 +40,6 @@ fn main() -> Result<()> {
4140
}
4241
flags::XtaskCmd::Install(cmd) => cmd.run(),
4342
flags::XtaskCmd::FuzzTests(_) => run_fuzzer(),
44-
flags::XtaskCmd::PreCache(cmd) => cmd.run(),
4543
flags::XtaskCmd::Release(cmd) => cmd.run(),
4644
flags::XtaskCmd::Promote(cmd) => cmd.run(),
4745
flags::XtaskCmd::Dist(flags) => {

xtask/src/pre_cache.rs

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

0 commit comments

Comments
 (0)