Skip to content

Commit

Permalink
Merge pull request #226 from helsing-ai/mara/nix
Browse files Browse the repository at this point in the history
Nix Integration
  • Loading branch information
mara-schulke authored Feb 28, 2024
2 parents 6870eea + bc256f6 commit d6c2479
Show file tree
Hide file tree
Showing 44 changed files with 738 additions and 536 deletions.
32 changes: 8 additions & 24 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Buffrs CLI
name: Buffrs CI

on:
push:
Expand All @@ -16,36 +16,20 @@ jobs:
steps:
- uses: actions/checkout@v3
- run: rustup update && rustup component add rustfmt
- run: cargo install buffrs && cd registry && buffrs install
- run: cargo fmt --check --all

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: rustup update && rustup component add clippy
- run: cargo install buffrs && cd registry && buffrs install
- name: Install Protoc
uses: arduino/setup-protoc@v2
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --workspace -- -D warnings -D clippy::all

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
lfs: "true"
- run: rustup update
- uses: Swatinem/rust-cache@v2
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Setup registry
uses: isbang/compose-action@v1.5.1
with:
compose-file: "./registry/docker-compose.yml"
- run: cargo test --workspace
env:
RUST_BACKTRACE: 1

deny:
runs-on: ubuntu-latest
steps:
Expand All @@ -55,7 +39,7 @@ jobs:
- run: cargo install cargo-deny || true
- run: cargo deny --workspace check

coverage:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -64,14 +48,14 @@ jobs:
- run: rustup update
- run: rustup component add llvm-tools-preview
- uses: Swatinem/rust-cache@v2
- run: cargo install buffrs && cd registry && buffrs install
- run: cargo install cargo-llvm-cov || true
- name: Install Protoc
uses: arduino/setup-protoc@v2
- name: Setup registry
uses: isbang/compose-action@v1.5.1
with:
compose-file: "./registry/docker-compose.yml"
- run: cargo install buffrs && cd registry && buffrs install
- run: cargo llvm-cov --workspace --fail-under-lines "$MINIMUM_LINE_COVERAGE_PERCENT"
env:
RUST_BACKTRACE: 1

typos:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Nix on Ubuntu Buffers CI
name: Nix

on:
push:
Expand All @@ -8,8 +8,11 @@ on:
workflow_dispatch:

jobs:
check_flake_w_nix_on_ubuntu:
runs-on: ubuntu-latest
check:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: DeterminateSystems/nix-installer-action@main
Expand Down
17 changes: 0 additions & 17 deletions .github/workflows/nix_ci_mac.yml

This file was deleted.

32 changes: 11 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 9 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "buffrs"
version = "0.7.6"
version = "0.8.0"
edition = "2021"
description = "Modern protobuf package management"
authors = [
"Mara Schulke <mara.schulke@helsing.ai>",
"André Sá De Mello <andre.mello@helsing.ai>",
"James Baker <james.baker@helsing.ai>",
"Mara Schulke <mara.schulke@helsing.ai>",
"Patrick Elsen <patrick.elsen@helsing.ai>",
"Tom Karwowski <tom.karwowski@helsing.ai>",
"Quentin Santos <quentin.santos@helsing.ai>",
"Thomas Pellissier-Tanon <thomas.pellissier-tanon@helsing.ai>",
"Robert Fink <robert.fink@helsing.ai>",
"James Baker <james.baker@helsing.ai>",
"Thomas Pellissier-Tanon <thomas.pellissier-tanon@helsing.ai>",
"Tom Karwowski <tom.karwowski@helsing.ai>",
]
repository = "https://github.com/helsing-ai/buffrs"
documentation = "https://docs.rs/buffrs"
Expand All @@ -27,16 +27,15 @@ members = ["registry"]
[[bin]]
name = "buffrs"
path = "src/main.rs"
required-features = ["build", "git", "validation"]
required-features = ["git", "validation"]

[[test]]
name = "e2e"
path = "tests/lib.rs"
test = true

[features]
default = ["build", "git", "validation"]
build = ["dep:tonic-build", "dep:protoc"]
default = ["git", "validation"]
validation = ["dep:anyhow", "dep:protobuf", "dep:protobuf-parse", "dep:diff-struct"]
git = []

Expand All @@ -53,16 +52,15 @@ human-panic = "1"
miette = { version = "5.10.0", features = ["fancy"] }
protobuf = { version = "3.3.0", optional = true }
protobuf-parse = { version = "3.3.0", optional = true }
protoc = { version = "2.28.0", optional = true }
reqwest = { version = "0.11", features = ["rustls-tls-native-roots"], default-features = false }
semver = { version = "1", features = ["serde"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
serde_typename = "0.1"
tar = "0.4"
thiserror = "1.0.49"
tokio = { version = "^1.26", features = ["fs", "rt", "macros", "process", "io-std", "tracing"] }
toml = "0.8.0"
tonic-build = { version = "0.10.0", optional = true }
tracing = "0.1"
tracing-subscriber = "0.3"
url = { version = "2.4", features = ["serde"] }
Expand All @@ -74,7 +72,7 @@ assert_cmd = "2.0"
assert_fs = "1.0"
axum = { version = "0.7.2", default-features = false, features = ["tokio", "http1"] }
fs_extra = "1.3"
gix = { version = "0.58.0", default-features = false}
gix = { version = "0.58.0", default-features = false }
hex = "0.4.3"
paste = "1.0.14"
predicates = "3.0"
Expand Down
4 changes: 2 additions & 2 deletions docs/src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
* [Manifest vs Lockfile](guide/manifest-vs-lockfile.md)
* [Buffrs Home](guide/buffrs-home.md)

* [Buffrs Integrations](integrations/index.md)
* [Cargo](integrations/cargo.md)
* [Buffrs Integrations]()
* [Cargo]()
* [Poetry]()
* [Npm]()

Expand Down
14 changes: 0 additions & 14 deletions docs/src/commands/buffrs-generate.md

This file was deleted.

4 changes: 1 addition & 3 deletions docs/src/commands/buffrs-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ Lists all protobuf files (`.proto`) managed by Buffrs to standard out.

This command lists all protobuf files managed by Buffrs. This way the
output can be fed dynamically into external code generation tools like
`protoc` to do customize the behavior of the generator beyond the capabilities
that Buffrs provides out of the box through [`buffrs
generate`](./buffrs-generate.md).
`protoc`.

### Example

Expand Down
40 changes: 40 additions & 0 deletions docs/src/commands/buffrs-lock-print-files.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## buffrs lock print-files

Prints the locked files as JSON to stdout.

### Synopsis

`buffrs lock print-files`

### Description

> Note: This command is designed for consumption through other scripts and
> programs.
Using this command you can retrieve a list of files that buffrs downloads
according to the lockfile. For correct behavior please make sure your
`Proto.lock` is up to date when using this command!

### Example

Given a project that depends on a `physics` package at version `1.0.0` and a
populated `Proto.lock`:

```
```

Running `buffrs lock print-files` will print the following output derived from
the lockfile:

```
[
{
"url": "https://your.internal.registry/artifactory/your-repository/physics/physics-1.0.0.tgz",
"digest": "sha256:61ecdcd949c7b234160dc5aacb4546a21512de4ff8ea85f2fdd7d5fff2bf92b5"
}
]
```

This way you can programmatically consume this (e.g. in nix, bash, etc) and
download the files if your project while maintaining integrity.
Loading

0 comments on commit d6c2479

Please sign in to comment.