feat: reconcile 2.0, event streams, version enforcement #386
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: PR | |
on: | |
pull_request: | |
env: | |
CARGO_TERM_COLOR: always | |
RUST_BACKTRACE: 1 | |
# https://releases.rs/docs/1.82.0/ release date | |
NIGHTLY_TOOLCHAIN: nightly-2024-10-17 | |
# Cancel in progress workflows on pull_requests. | |
# https://docs.github.com/en/actions/using-jobs/using-concurrency#example-using-a-fallback-value | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: true | |
jobs: | |
# TODO move to a release ci | |
# build: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout | |
# uses: actions/checkout@v4 | |
# with: | |
# path: snarkos-test | |
# - name: Checkout snarkOS | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: AleoNet/snarkOS | |
# path: snarkos | |
# - name: Checkout snarkVM | |
# uses: actions/checkout@v4 | |
# with: | |
# repository: AleoNet/snarkVM | |
# path: snarkvm | |
# - name: Use mold linker | |
# uses: rui314/setup-mold@v1 | |
# - name: Install nightly and cranelift | |
# uses: dtolnay/rust-toolchain@nightly | |
# with: | |
# toolchain: nightly | |
# components: rustc-codegen-cranelift-preview | |
# - uses: Swatinem/rust-cache@v2 | |
# with: | |
# key: cache-v1 | |
# - name: Build | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift -Zbuild-std=std,panic_abort -Zbuild-std-features=panic_immediate_abort | |
# run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} build --verbose | |
fmt: | |
runs-on: ubuntu-latest | |
steps: | |
- name: 📥 Checkout | |
uses: actions/checkout@v4 | |
- name: ☁️ Install Nightly | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} | |
components: rustfmt | |
- name: 📋 Format Check | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} fmt -- --check | |
test: | |
runs-on: ubuntu-latest | |
permissions: read-all | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
steps: | |
- name: 📥 Checkout | |
uses: actions/checkout@v4 | |
- name: 🥬 Use Mold Linker | |
uses: rui314/setup-mold@v1 | |
- name: ☁️ Install Nightly | |
uses: dtolnay/rust-toolchain@nightly | |
with: | |
toolchain: ${{ env.NIGHTLY_TOOLCHAIN }} | |
components: rustc-codegen-cranelift-preview clippy | |
- name: 🫙 Cache | |
uses: Swatinem/rust-cache@v2 | |
with: | |
key: cache-v1 | |
cache-on-failure: true | |
- name: ☁️ Install Nextest | |
uses: taiki-e/install-action@nextest | |
# - name: ☁️ Install cargo-machete | |
# run: cargo install cargo-machete | |
# - name: 📋 Clippy Check | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
# run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} clippy --all --all-targets -- -D warnings | |
# - name: 📋 Check Unused Deps | |
# if: always() | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
# run: cargo machete | |
- uses: dorny/paths-filter@v3 | |
id: changes | |
with: | |
base: ${{ github.ref_name }} | |
filters: | | |
top_toml: | |
- 'Cargo.toml' | |
aot: | |
- 'crates/aot/**/*' | |
checkpoint: | |
- 'crates/checkpoint/**/*' | |
control_plane: | |
- 'crates/controlplane/**/*' | |
agent: | |
- 'crates/agent/**/*' | |
scli: | |
- 'crates/cli/**/*' | |
common: | |
- 'crates/common/**/*' | |
- name: 🧪 Test All | |
if: steps.changes.outputs.top_toml == 'true' | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run --all --verbose --fail-fast --all-features --exclude snops-agent --exclude xtask | |
- name: 🧪 Test Aot | |
if: steps.changes.outputs.aot == 'true' && steps.changes.outputs.top_toml == 'false' | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snarkos-aot --verbose --fail-fast --all-features | |
- name: 🧪 Test Checkpoint | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
if: steps.changes.outputs.checkpoint == 'true' && steps.changes.outputs.top_toml == 'false' | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-checkpoint --verbose --fail-fast --all-features | |
- name: 🧪 Test Common | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
if: steps.changes.outputs.common == 'true' && steps.changes.outputs.top_toml == 'false' | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-common --verbose --fail-fast --all-features | |
- name: 🧪 Test Control Plane | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
if: (steps.changes.outputs.control_plane == 'true' || steps.changes.outputs.common == 'true') && steps.changes.outputs.top_toml == 'false' | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops --verbose --fail-fast --all-features | |
- name: 🧪 Test Agent | |
# env: | |
# RUSTFLAGS: "" | |
if: (steps.changes.outputs.agent == 'true' || steps.changes.outputs.common == 'true') | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-agent --verbose --fail-fast --all-features | |
- name: 🧪 Test Scli | |
# env: | |
# RUSTFLAGS: -Zcodegen-backend=cranelift | |
if: (steps.changes.outputs.scli == 'true' || steps.changes.outputs.common == 'true') && steps.changes.outputs.top_toml == 'false' | |
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-cli --verbose --fail-fast --all-features |