Skip to content

Commit

Permalink
Merge pull request #14 from gattaca-com/bugfixes_and_cleanups
Browse files Browse the repository at this point in the history
Bugfixes and cleanups
  • Loading branch information
DomAtGattaca authored Feb 1, 2024
2 parents 0d61c4c + 523f926 commit 6a945fa
Show file tree
Hide file tree
Showing 97 changed files with 2,892 additions and 1,857 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Rust

on:
push:
branches: [ main ]
branches: [ main, develop ]

env:
CARGO_TERM_COLOR: always
Expand All @@ -18,6 +18,10 @@ jobs:
with:
fetch-depth: '0'
path: ./repos/${{ secrets.REPO_NAME }}
ref: ${{ github.ref }}

- name: Set Image Name
run: echo "IMAGE_NAME=$(if [ ${{ github.ref }} == 'refs/heads/main' ]; then echo 'latest'; else echo 'develop'; fi)" >> $GITHUB_ENV

- name: Run Dockerfile
env:
Expand All @@ -28,8 +32,7 @@ jobs:
REGISTRY_URL: ${{ secrets.REGISTRY_URL }}
REPO_NAME: ${{ secrets.REPO_NAME }}
run: |
IMAGE_NAME=latest
DOCKER_BUILDKIT=1 docker build -t helix:$IMAGE_NAME --build-arg AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --build-arg AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --build-arg REPO_NAME=$REPO_NAME -f ./repos/$REPO_NAME/Dockerfile .
DOCKER_BUILDKIT=1 docker tag helix:$IMAGE_NAME $REGISTRY_URL/helix:$IMAGE_NAME
DOCKER_BUILDKIT=1 docker build -t helix:${{ env.IMAGE_NAME }} --build-arg AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID --build-arg AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY --build-arg REPO_NAME=$REPO_NAME -f ./repos/$REPO_NAME/Dockerfile .
DOCKER_BUILDKIT=1 docker tag helix:${{ env.IMAGE_NAME }} $REGISTRY_URL/helix:${{ env.IMAGE_NAME }}
DOCKER_BUILDKIT=1 docker login https://$REGISTRY_URL/ -u "$DOCKER_REG_USR" -p "$DOCKER_REG_PW"
DOCKER_BUILDKIT=1 docker push $REGISTRY_URL/helix:$IMAGE_NAME
DOCKER_BUILDKIT=1 docker push $REGISTRY_URL/helix:${{ env.IMAGE_NAME }}
59 changes: 59 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Rust Linting

on:
pull_request:
branches: [ main, develop ]
types: [opened, synchronize, reopened]

env:
CARGO_TERM_COLOR: always

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 30

steps:
- uses: actions/checkout@v4
with:
fetch-depth: '0'
path: ./repos/${{ secrets.REPO_NAME }}
ref: ${{ github.ref }}

# Install Protocol Buffers Compiler
- name: Install Protobuf Compiler (protoc)
run: sudo apt-get install -y protobuf-compiler

- name: Change to project directory
run: cd ./repos/${{ secrets.REPO_NAME }}

# Install nightly toolchain and rustfmt
- name: Install nightly toolchain and rustfmt
run: |
rustup toolchain install nightly
rustup component add rustfmt --toolchain nightly
# Rust Linting with Clippy
- uses: dtolnay/rust-toolchain@clippy
- uses: Swatinem/rust-cache@v2
with:
cache-on-failure: true

# Run General Clippy Linting
- name: Clippy
run: cargo clippy --all-features
env:
RUSTFLAGS: -D warnings
working-directory: ./repos/${{ secrets.REPO_NAME }}

# Check Code Formatting
- name: Rustfmt
run: cargo +nightly fmt --all --check
working-directory: ./repos/${{ secrets.REPO_NAME }}

# Check Documentation
- name: Docs
run: cargo doc --workspace --all-features --no-deps
env:
RUSTDOCFLAGS: --cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options -D warnings
working-directory: ./repos/${{ secrets.REPO_NAME }}
55 changes: 45 additions & 10 deletions Cargo.lock

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

8 changes: 5 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ async-trait = "0.1"
axum = "0.7.4"
dashmap = { version = "5.5.3", features = [] }
futures = "0.3"
hyper = "0.14.27"
http = "0.2.9"
reqwest = { version = "0.11", features = ["json", "native-tls-vendored"] }
hyper = "1.1.0"
http = "1.0.0"
tower = { version = "0.4.13", features = ["full"] }
reqwest = { version = "0.11.23", features = ["json", "native-tls-vendored", "stream"] }
tokio = { version = "1.33.0", features = ["full"] }
tokio-stream = "0.1"
tower-http = { version = "0.5.1", features = ["limit"] }
Expand Down Expand Up @@ -72,6 +73,7 @@ env_logger = "0.9"
# Misc
auto_impl = "1.0.1"
thiserror = "1.0.49"
uuid = { version = "1.5", features = ["fast-rng", "v4"] }

# Broadcasting
fiber = { git = "https://github.com/chainbound/fiber-rs.git", tag = "v0.5.1" }
3 changes: 2 additions & 1 deletion crates/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ helix-housekeeper.workspace = true
# Async and Networking
async-trait = { workspace = true }
axum = { workspace = true }
tower = { workspace = true }
dashmap = { workspace = true }
futures = { workspace = true }
hyper = { workspace = true }
Expand Down Expand Up @@ -49,7 +50,7 @@ auto_impl.workspace = true
rand = "0.8"
thiserror = { workspace = true }
tracing = { workspace = true }
uuid = { version = "1.5", features = ["fast-rng", "v4"] }
uuid = { workspace = true }
bytes = "1.5"

[build-dependencies]
Expand Down
8 changes: 3 additions & 5 deletions crates/api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ fn main() {
tonic_build::configure()
.build_client(true)
.build_server(true)
.compile(
&["src/gossiper/proto/gossipclient.proto"],
&["src/gossiper/proto"],
).unwrap();
}
.compile(&["src/gossiper/proto/gossipclient.proto"], &["src/gossiper/proto"])
.unwrap();
}
Loading

0 comments on commit 6a945fa

Please sign in to comment.