Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use rust-cache GitHub action in Wasmi's CI #1098

Merged
merged 9 commits into from
Jul 1, 2024
213 changes: 44 additions & 169 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: Rust - Continuous Integration

on:
push:
branches: [master]
branches: [main]
pull_request:
branches: [master]
branches: [main]

# disable running jobs on earlier commits
concurrency:
Expand All @@ -20,47 +20,27 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown, x86_64-unknown-none
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Build (default features)
run: cargo build --workspace --locked
run: cargo build --workspace --locked --verbose
- name: Build (all features)
run: cargo build --workspace --locked --all-features
run: cargo build --workspace --locked --all-features --verbose
- name: Build (no_std + no-hash-maps)
run: cargo build --locked -p wasmi_collections --no-default-features --features no-hash-maps
run: cargo build --locked -p wasmi_collections --no-default-features --features no-hash-maps --verbose
- name: Build (no_std)
run: cargo build --workspace --locked --lib --no-default-features --target x86_64-unknown-none --exclude wasmi_cli --exclude wasmi_wasi --exclude wasmi_fuzz
run: cargo build --workspace --locked --lib --no-default-features --target x86_64-unknown-none --verbose --exclude wasmi_cli --exclude wasmi_wasi --exclude wasmi_fuzz
- name: Build (wasm32)
run: cargo build --workspace --locked --lib --no-default-features --target wasm32-unknown-unknown --exclude wasmi_cli --exclude wasmi_wasi --exclude wasmi_fuzz
run: cargo build --workspace --locked --lib --no-default-features --target wasm32-unknown-unknown --verbose --exclude wasmi_cli --exclude wasmi_wasi --exclude wasmi_fuzz

test-asan:
name: Test (Address Sanitizer)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: dtolnay/rust-toolchain@nightly
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Show Rust Toolchain
Expand All @@ -70,7 +50,7 @@ jobs:
- name: Build Tests
env:
RUSTFLAGS: "--cfg debug_assertions -Zsanitizer=address"
run: cargo build --tests --workspace --locked -Zbuild-std --target x86_64-unknown-linux-gnu
run: cargo build --tests --workspace --locked -Zbuild-std --target x86_64-unknown-linux-gnu --verbose
- name: Test
env:
RUSTFLAGS: "--cfg debug_assertions -Zsanitizer=address"
Expand All @@ -85,36 +65,26 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: dtolnay/rust-toolchain@stable
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Build (default features)
env:
RUSTFLAGS: "--cfg debug_assertions"
run: cargo build --tests --workspace --locked --release
run: cargo build --tests --workspace --locked --verbose
- name: Test (default features)
env:
RUSTFLAGS: "--cfg debug_assertions"
run: cargo test --workspace --locked --release
run: cargo test --workspace --locked
- name: Build (all features)
env:
RUSTFLAGS: "--cfg debug_assertions"
run: cargo build --tests --workspace --locked --release --all-features
run: cargo build --tests --workspace --locked --all-features --verbose
- name: Test (all features)
env:
RUSTFLAGS: "--cfg debug_assertions"
run: cargo test --workspace --locked --release --all-features
run: cargo test --workspace --locked --all-features

fmt:
name: Formatting
Expand All @@ -137,18 +107,8 @@ jobs:
- uses: dtolnay/rust-toolchain@stable
with:
components: rust-docs, rust-src
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Check Docs
env:
RUSTDOCFLAGS: "-D warnings"
Expand All @@ -174,18 +134,8 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: dtolnay/rust-toolchain@nightly
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Install cargo-udeps
Expand All @@ -202,22 +152,13 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: dtolnay/rust-toolchain@nightly
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
~/target/x86_64-unknown-linux-gnu/
~/target/x86_64-unknown-linux-gnu/release/
cache-directories: |
~/fuzz/corpus/
~/fuzz/corpus/translate/
~/fuzz/curpus/translate_metered/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
~/fuzz/corpus/translate_metered/
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Install cargo-fuzz
Expand All @@ -238,23 +179,12 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: dtolnay/rust-toolchain@nightly
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
~/target/x86_64-unknown-linux-gnu/
~/target/x86_64-unknown-linux-gnu/release/
~/target/release/
~/target/debug/
cache-directories: |
~/fuzz/corpus/
~/fuzz/corpus/execute/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Install cargo-fuzz
Expand All @@ -273,23 +203,12 @@ jobs:
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- uses: dtolnay/rust-toolchain@nightly
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
~/target/x86_64-unknown-linux-gnu/
~/target/x86_64-unknown-linux-gnu/release/
~/target/release/
~/target/debug/
~/fuzz/corpus/execute/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
cache-directories: |
~/fuzz/corpus/
~/fuzz/corpus/differential/
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Install cargo-fuzz
Expand All @@ -311,20 +230,8 @@ jobs:
with:
components: miri
targets: x86_64-unknown-linux-gnu
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/bin/cargo-nextest
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
~/target/miri/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Install cargo-nextest
Expand All @@ -348,20 +255,8 @@ jobs:
with:
components: miri
targets: x86_64-unknown-linux-gnu
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/bin/cargo-nextest
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
~/target/miri/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Install cargo-nextest
Expand All @@ -385,18 +280,8 @@ jobs:
- uses: dtolnay/rust-toolchain@nightly
with:
components: clippy
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Clippy (default features)
Expand All @@ -421,18 +306,8 @@ jobs:
with:
fetch-depth: 0
- uses: dtolnay/rust-toolchain@stable
- name: Set up Cargo cache
uses: actions/cache@v4
continue-on-error: false
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
~/target/
key: ${{ runner.os }}-${{ github.job }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: ${{ runner.os }}-${{ github.job }}-
- name: Set up Rust cache
uses: Swatinem/rust-cache@v2
- name: Checkout Submodules
run: git submodule update --init --recursive
- name: Run cargo-tarpaulin (default features)
Expand Down
Loading