Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
fanatid committed Oct 3, 2024
0 parents commit 793a6df
Show file tree
Hide file tree
Showing 23 changed files with 6,816 additions and 0 deletions.
89 changes: 89 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
permissions:
contents: write

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
paths:
- '.github/workflows/release.yml'
push:
branches:
- 'master'
- 'v1.18'
- 'v2.0'
tags:
- 'v*'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
release:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ["${{ matrix.os }}"]
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target
key: ${{ matrix.os }}-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}-v001
restore-keys: |
${{ matrix.os }}-cargo-${{ hashFiles('rust-toolchain.toml') }}
- name: Set rust version
run: |
RUST_VERSION="$(grep -oP 'channel = "\K\d\.\d+\.\d+(?=")' rust-toolchain.toml)"
echo "RUST_VERSION=$RUST_VERSION" >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev protobuf-compiler
- name: Build release
run: cargo build --release --bin grpc-kafka

- name: Rename binaries for ubuntu20 release
if: matrix.os == 'ubuntu-20.04'
run: |
mv target/release/grpc-kafka target/release/grpc-kafka-20.04
- name: Rename binaries for ubuntu22 release
if: matrix.os == 'ubuntu-22.04'
run: |
mv target/release/grpc-kafka target/release/grpc-kafka-22.04
- name: Deleteing directories to avoid upload conflict
run: |
rm -rf \
target/release/grpc-kafka.d
- uses: actions/upload-artifact@v4
with:
name: yellowstone-grpc-kafka-${{ github.sha }}-${{ matrix.os }}
path: |
target/release/grpc-kafka-*
- name: Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v2
with:
files: |
target/release/grpc-kafka-*
85 changes: 85 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
push:
branches:
- 'master'
- 'v1.18'
- 'v2.0'
workflow_dispatch:

env:
CARGO_TERM_COLOR: always

jobs:
test:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ["${{ matrix.os }}"]
steps:
- uses: actions/checkout@v4

- uses: actions/cache@v4
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
./target
key: ${{ matrix.os }}-cargo-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('**/Cargo.lock') }}-v001
restore-keys: |
${{ matrix.os }}-cargo-${{ hashFiles('rust-toolchain.toml') }}
- name: Set rust version
run: |
RUST_VERSION="$(grep -oP 'channel = "\K\d\.\d+\.\d+(?=")' rust-toolchain.toml)"
echo "RUST_VERSION=$RUST_VERSION" >> "$GITHUB_ENV"
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: nightly
components: rustfmt

- uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ env.RUST_VERSION }}
components: clippy

- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y libsasl2-dev protobuf-compiler
- name: cargo tree
run: |
cargo tree
git checkout Cargo.lock
cargo tree --frozen
- name: cargo fmt
run: cargo +nightly fmt --all -- --check

- name: cargo deny check advisories
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: check advisories

- name: cargo clippy
run: cargo clippy --workspace --all-targets #-- --deny=warnings

- name: check
run: cargo check --all-targets
- name: check without default features
run: cargo check --all-targets --no-default-features
- name: check only with `metrics` feature
run: cargo check --all-targets --no-default-features --features="metrics"
- name: check only with `kafka` feature
run: cargo check --all-targets --no-default-features --features="kafka"

- name: Run tests
run: cargo test --all-targets --verbose
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.idea
/.vscode
/__pycache__
/target
/test-ledger
/venv

config-test.json
dump.rdb
*.sw?
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

**Note:** Version 0 of Semantic Versioning is handled differently from version 1 and above.
The minor version will be incremented upon a breaking change and the patch version will be incremented for features.

## [Unreleased]

### Fixes

### Features

### Breaking

## [1.0.0] - 2024-10-03

- Init. Moved from https://github.com/rpcpool/yellowstone-grpc.
Loading

0 comments on commit 793a6df

Please sign in to comment.