257 fix informational issues part 4 #458
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
pull_request: | |
branches: | |
- '**' # every branch | |
- '!main' # excluding main | |
name: continuous-integration-dev | |
jobs: | |
ci: | |
strategy: | |
max-parallel: 1 | |
matrix: | |
os: [ ubuntu-latest, macos-latest ] | |
include: | |
- os: ubuntu-latest | |
sccache-path: /home/runner/.cache/sccache | |
- os: macos-latest | |
sccache-path: /Users/runner/Library/Caches/Mozilla.sccache | |
runs-on: ${{ matrix.os }} | |
env: | |
RUST_BACKTRACE: full | |
RUSTC_WRAPPER: sccache | |
SCCACHE_CACHE_SIZE: 2G | |
SCCACHE_DIR: ${{ matrix.sccache-path }} | |
steps: | |
- name: Freeing up more disk space | |
run: | | |
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android | |
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET | |
sudo rm -rf /opt/ghc | |
sudo rm -rf /usr/local/share/boost | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v2 | |
- name: Install sccache (ubuntu-latest) | |
if: matrix.os == 'ubuntu-latest' | |
env: | |
LINK: https://github.com/mozilla/sccache/releases/download | |
SCCACHE_VERSION: 0.2.13 | |
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 | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install sccache (macos-latest) | |
if: matrix.os == 'macos-latest' | |
run: | | |
brew update | |
brew install sccache | |
- name: Setup Rust toolchain | |
# Call `rustup show` as a hack so that the toolchain defined in rust-toolchain.toml is installed | |
run: rustup show | |
- name: Use Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
cache-on-failure: true | |
key: "${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}" | |
shared-key: "shared" | |
- name: Save sccache | |
uses: pat-s/always-upload-cache@v3 | |
continue-on-error: true | |
with: | |
path: "${{ matrix.sccache-path }}" | |
key: "${{ matrix.os }}-sccache-${{ hashFiles('**/Cargo.lock') }}" | |
restore-keys: "${{ matrix.os }}-sccache-" | |
- name: Start sccache server | |
run: sccache --start-server | |
- name: Install Protoc | |
uses: arduino/setup-protoc@v1 | |
with: | |
repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Build | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --all-features | |
- name: Test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
args: --all --all-features | |
- name: Rustfmt | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Print sccache stats | |
run: sccache --show-stats | |
- name: Stop sccache server | |
run: sccache --stop-server || true | |