cache codecov and m1

This commit is contained in:
gluaxspeed 2021-07-14 17:52:57 -07:00
parent 8596e2cd1f
commit dc37ef37f2

View File

@ -60,9 +60,7 @@ jobs:
iwr -useb get.scoop.sh | iex iwr -useb get.scoop.sh | iex
Set-ExecutionPolicy RemoteSigned -scope CurrentUser Set-ExecutionPolicy RemoteSigned -scope CurrentUser
scoop install sccache scoop install sccache
Get-ChildItem C:\Users\runneradmin\scoop\shims
echo "C:\Users\runneradmin\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "C:\Users\runneradmin\scoop\shims" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "$GITHUB_PATH"
- name: Install Rust Stable - name: Install Rust Stable
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
@ -93,7 +91,6 @@ jobs:
- name: Start sccache server - name: Start sccache server
run: | run: |
echo "$GITHUB_PATH"
sccache --start-server sccache --start-server
- name: Install cargo-all-features - name: Install cargo-all-features
@ -114,6 +111,10 @@ jobs:
test-package-macos_m1: test-package-macos_m1:
name: Test Package macOS M1 name: Test Package macOS M1
runs-on: macos-latest runs-on: macos-latest
env:
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /Users/runner/Library/Caches/Mozilla.sccache
steps: steps:
- name: Xcode Select - name: Xcode Select
uses: devbotsxyz/xcode-select@v1.1.0 uses: devbotsxyz/xcode-select@v1.1.0
@ -121,6 +122,11 @@ jobs:
- name: Checkout - name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v2
- name: Install sccache
run: |
brew update
brew install sccache
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
@ -129,6 +135,30 @@ jobs:
toolchain: stable toolchain: stable
override: true override: true
components: rustfmt components: rustfmt
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: m1-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
m1-cargo-
- name: Save sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: /Users/runner/Library/Caches/Mozilla.sccache
key: m1-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
m1-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Install cargo-all-features - name: Install cargo-all-features
run: | run: |
@ -142,15 +172,36 @@ jobs:
MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \ MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version) \
cd package && cargo test-all-features cd package && cargo test-all-features
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true
codecov: codecov:
name: Code Coverage name: Code Coverage
runs-on: ubuntu-latest runs-on: ubuntu-latest
env: env:
RUSTC_BOOTSTRAP: 1 RUSTC_BOOTSTRAP: 1
RUSTC_WRAPPER: sccache
SCCACHE_CACHE_SIZE: 2G
SCCACHE_DIR: /home/runner/.cache/sccache
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v1 uses: actions/checkout@v1
- name: Install sccache Ubuntu
env:
LINK: https://github.com/mozilla/sccache/releases/download
SCCACHE_VERSION: v0.2.15
run: |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl
mkdir -p $HOME/.local/bin
curl -L "$LINK/$SCCACHE_VERSION/$SCCACHE_FILE.tar.gz" | tar xz
mv -f $SCCACHE_FILE/sccache $HOME/.local/bin/sccache
chmod +x $HOME/.local/bin/sccache
echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Install Rust - name: Install Rust
uses: actions-rs/toolchain@v1 uses: actions-rs/toolchain@v1
with: with:
@ -159,6 +210,30 @@ jobs:
override: true override: true
components: rustfmt components: rustfmt
- name: Cache cargo registry
uses: actions/cache@v2
continue-on-error: false
with:
path: |
~/.cargo/registry
~/.cargo/git
key: codecov-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
codecov-cargo-
- name: Save sccache
uses: actions/cache@v2
continue-on-error: false
with:
path: /Users/runner/Library/Caches/Mozilla.sccache
key: codecov-sccache-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
codecov-sccache-
- name: Start sccache server
run: |
sccache --start-server
- name: Test - name: Test
uses: actions-rs/cargo@v1 uses: actions-rs/cargo@v1
with: with:
@ -189,3 +264,9 @@ jobs:
with: with:
github-token: ${{ secrets.GITHUB_TOKEN }} github-token: ${{ secrets.GITHUB_TOKEN }}
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
- name: Print sccache stats
run: sccache --show-stats
- name: Stop sccache server
run: sccache --stop-server || true