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

refactor: xtask, and crate names #311

Merged
merged 15 commits into from
Nov 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
version: 2
updates:
# Maintain dependencies for Cargo
- package-ecosystem: cargo
directory: "/"
schedule:
interval: weekly
open-pull-requests-limit: 10
# - package-ecosystem: cargo
# directory: "/"
# schedule:
# interval: weekly
# open-pull-requests-limit: 10

# Maintain dependencies for GitHub Actions
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: weekly
interval: monthly
open-pull-requests-limit: 10
40 changes: 20 additions & 20 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
# https://releases.rs/docs/1.81.0/ release date
NIGHTLY_TOOLCHAIN: nightly-2024-09-05
# 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
Expand Down Expand Up @@ -75,7 +75,7 @@ jobs:
runs-on: ubuntu-latest
permissions: read-all
# env:
# RUSTFLAGS: -Zcodegen-backend=cranelift broken for snarkos/vm atm
# RUSTFLAGS: -Zcodegen-backend=cranelift

steps:
- name: 📥 Checkout
Expand Down Expand Up @@ -125,48 +125,48 @@ jobs:
checkpoint:
- 'crates/checkpoint/**/*'
control_plane:
- 'crates/snops/**/*'
- 'crates/controlplane/**/*'
agent:
- 'crates/snops-agent/**/*'
- 'crates/agent/**/*'
scli:
- 'crates/snops-cli/**/*'
- 'crates/cli/**/*'
common:
- 'crates/snops-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
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
# 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 checkpoint --verbose --fail-fast --all-features
run: cargo +${{ env.NIGHTLY_TOOLCHAIN }} nextest run -p snops-checkpoint --verbose --fail-fast --all-features

- name: 🧪 Test Common
env:
RUSTFLAGS: -Zcodegen-backend=cranelift
# 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
# 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: -Zcodegen-backend=cranelift
if: (steps.changes.outputs.agent == 'true' || steps.changes.outputs.common == 'true') && steps.changes.outputs.top_toml == 'false'
# 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
# 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
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,7 @@

# mdbook files
book

# report files
report.html
report.json
17 changes: 15 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@ This file describes the process for contributing to `snarkops`.

## Starting

We use the [xtask convention](https://github.com/matklad/cargo-xtask) to add helpful commands for development.
We also recommend usage of [cargo-watch](https://github.com/watchexec/cargo-watch), to help for development purposes.

The `xtask` commands can be triggered by doing `cargo xtask cmd`.
The list of commands are as follows, and you can always do `--help` for more info:
- `clipages`: updates the markdown files in `./snops_book/user_guide/clis`.
- `mangen`: generates man files and puts them in the target directory.
- `fmt`: can be used to format the codebase, requires nightly, or check the formatting is ok.
- `lint`: runs clippy against the codebase, requires nightly.
- `udeps`: installs [cargo-shear](https://github.com/boshen/cargo-shear) to do a naive unused dependencies check.
- `install-upx`: linux only command to install [upx](https://github.com/upx/upx), which can be used in the build command to super compress binaries.
- `build: gives makes building the different binaries easier, by automatically setting flags and etc for specific linkers, cranelift, or other options.
- `dev`: runs [cargo-watch](https://github.com/watchexec/cargo-watch) for the specified binary target.
<!-- TODO DEVELOPING DOCS -->
<!-- Then please read the
[developing instructions](https://github.com/monadicus/snarkops/blob/main/DEVELOPING.md) for setting up your environment. -->

## Commits
<!-- ## Commits

Your commits must follow specific guidelines.
Your commits must follow specific guidelines. -->

<!-- TODO IDR if we enforce this -->
<!-- ### Signed Commits
Expand Down
Loading
Loading