Zombienet migration #2653
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
name: Run Linters | |
on: | |
pull_request: | |
branches: [manta] | |
push: | |
branches: [manta] | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
jobs: | |
start-checks: | |
timeout-minutes: 120 | |
runs-on: runtime | |
container: | |
image: ubuntu:20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Run yamllint | |
uses: actionshub/[email protected] | |
- name: install sccache | |
env: | |
SCCACHE_RELEASE_URL: https://github.com/mozilla/sccache/releases/download | |
SCCACHE_VERSION: v0.5.3 | |
run: | | |
apt update | |
apt install -y curl | |
SCCACHE_FILE=sccache-$SCCACHE_VERSION-x86_64-unknown-linux-musl | |
mkdir -p $HOME/.local/bin | |
curl -L "$SCCACHE_RELEASE_URL/$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 | |
echo "$HOME/.cargo/bin" >> $GITHUB_PATH | |
- name: cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
key: cargo-registry-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-registry- | |
- name: cache sccache | |
uses: actions/cache@v2 | |
continue-on-error: false | |
with: | |
path: ~/.cache/sccache | |
key: sccache-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
sccache- | |
- name: start sccache server | |
run: sccache --start-server | |
- name: init rust toolchain | |
# NOTE: We use nightly Rust only to get nightly fmt & clippy | |
# TODO: use nightly after https://github.com/clap-rs/clap/issues/4733 fixed. | |
shell: bash | |
run: | | |
apt update | |
apt install -y pkg-config libssl-dev protobuf-compiler curl build-essential clang git | |
protoc --version | |
curl -s https://sh.rustup.rs -sSf | sh -s -- -y | |
source ${HOME}/.cargo/env | |
rustup toolchain install nightly-2023-03-13 | |
rustup default nightly-2023-03-13 | |
cargo install taplo-cli | |
- name: Check Formatting | |
env: | |
RUST_BACKTRACE: full | |
RUSTC_WRAPPER: sccache | |
SCCACHE_CACHE_SIZE: 2G | |
SCCACHE_DIR: ~/.cache/sccache | |
shell: bash | |
run: | | |
source ${HOME}/.cargo/env | |
cargo fmt --all -- --check | |
$HOME/.cargo/bin/taplo fmt --check | |
$HOME/.cargo/bin/taplo lint | |
- name: cache cargo build | |
uses: actions/cache@v2 | |
with: | |
path: | | |
./target | |
key: cargo-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} | |
restore-keys: | | |
cargo-build-${{ hashFiles('**/Cargo.toml') }}-${{ hashFiles('**/Cargo.lock') }} | |
cargo-build- | |
- name: Cargo Check & Clippy | |
env: | |
RUST_BACKTRACE: full | |
RUSTC_WRAPPER: sccache | |
SCCACHE_CACHE_SIZE: 2G | |
SCCACHE_DIR: ~/.cache/sccache | |
shell: bash | |
run: | | |
source ${HOME}/.cargo/env | |
SKIP_WASM_BUILD=1 cargo check --no-default-features | |
SKIP_WASM_BUILD=1 cargo clippy --all-targets --all-features -- -D warnings | |
- name: stop sccache server | |
run: sccache --stop-server || true |