Skip to content
This repository has been archived by the owner on Nov 1, 2023. It is now read-only.

use sccache more consistently #47

Merged
merged 3 commits into from
Sep 29, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 38 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,38 @@ on: [push, pull_request]

env:
CARGO_TERM_COLOR: always
SCCACHE_DIR: ${{github.workspace}}/sccache/
SCCACHE_CACHE_SIZE: 1G

jobs:
agent:
runs-on: "${{ matrix.os }}"
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
cache-name: cache-rust-target
- name: Rust Prereq Cache
uses: actions/cache@v2
id: cache-rust-prereqs
with:
path: |
src/agent/target
sccache
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
~/.cache/sccache
key: agent-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
key: rust-${{ runner.os }}-2020-09
restore-keys: |
rust-${{ runner.os }}
- name: Install Rust Prereqs
if: steps.cache-rust-prereqs.outputs.cache-hit != 'true'
shell: bash
run: src/ci/rust-prereqs.sh
- name: Rust Compile Cache
uses: actions/cache@v2
with:
path: |
sccache
src/agent/target
key: agent-${{ runner.os }}-${{ hashFiles('src/agent/Cargo.lock') }}
restore-keys: |
agent-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
agent-${{ runner.os }}
- name: Linux Prereqs
run: |
Expand Down Expand Up @@ -111,19 +124,30 @@ jobs:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v2
env:
cache-name: cache-rust-proxy
- name: Rust Prereq Cache
uses: actions/cache@v2
id: cache-rust-prereqs
with:
path: |
src/proxy-manager/target
sccache
~/.cargo/registry
~/.cargo/git
~/.cargo/bin
~/.cache/sccache
key: proxy-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
key: rust-${{ runner.os }}-2020-09
restore-keys: |
rust-${{ runner.os }}
- name: Install Rust Prereqs
if: steps.cache-rust-prereqs.outputs.cache-hit != 'true'
shell: bash
run: src/ci/rust-prereqs.sh
- name: Rust Compile Cache
uses: actions/cache@v2
with:
path: |
sccache
src/proxy-manager/target
key: proxy-${{ runner.os }}-${{ hashFiles('src/proxy-manager/Cargo.lock') }}
restore-keys: |
proxy-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
proxy-${{ runner.os }}
- run: src/ci/proxy.sh
- uses: actions/upload-artifact@v2.1.4
Expand Down
8 changes: 2 additions & 6 deletions src/ci/agent.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,12 @@

set -ex

export RUSTC_WRAPPER=$(which sccache)

mkdir -p artifacts/agent

cd src/agent
cargo install sccache || echo 'already installed?'
export RUSTC_WRAPPER=$(which sccache)
cargo install cargo-audit
cargo install cargo-license || echo 'already installed?'
cargo fmt -- --check
rustup component add clippy
cargo clippy --release -- -D warnings
# RUSTSEC-2019-0031: a dependency spin (pulled in from ring) is not actively maintained
# RUSTSEC-2020-0016: a dependency net2 (pulled in from tokio) is deprecated
# RUSTSEC-2020-0036: a dependency failure (pulled from proc-maps) is deprecated
Expand Down
7 changes: 2 additions & 5 deletions src/ci/proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@

set -ex

export RUSTC_WRAPPER=$(which sccache)

mkdir -p artifacts/proxy

cd src/proxy-manager
cargo install sccache || echo 'already installed?'
export RUSTC_WRAPPER=$(which sccache)
cargo install cargo-audit
cargo install cargo-license || echo 'already installed'
cargo fmt -- --check
rustup component add clippy
cargo clippy --release -- -D warnings
# RUSTSEC-2020-0016: a dependency net2 (pulled in from tokio) is deprecated
cargo audit -D --ignore RUSTSEC-2020-0016
Expand Down
12 changes: 12 additions & 0 deletions src/ci/rust-prereqs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.

set -ex

cargo install sccache || echo 'already installed?'
export RUSTC_WRAPPER=$(which sccache)
cargo install cargo-audit
cargo install cargo-license || echo 'already installed?'
rustup component add clippy