feat
: add github workflows for building and checking fmt..
#11
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: Build yellowstone-vixen crates | |
# This workflow uses github runners. | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
# This may be adjusted to whatever suits best your runners config. | |
# Current config will build on manual trigger or pull-request (each push) | |
on: | |
# pull_request can be removed, to save minutes on github runners | |
pull_request: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
build: | |
# This can be also be runned on self-hosted github runners | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: checkout repo | |
uses: actions/checkout@v4 | |
# This step can be omited, to save storage space on the organization account | |
# Build process will take longer | |
- name: Cache Build Dependencies | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cargo/bin/ | |
~/.cargo/registry/index/ | |
~/.cargo/registry/cache/ | |
~/.cargo/git/db/ | |
yellowstone-vixen/target/ | |
key: cargo-${{ hashFiles('**/Cargo.lock') }}-0001 | |
# Cache Rust Nightly Toolchain | |
- name: Cache Rust Nightly | |
id: cache-rust-nightly | |
uses: actions/cache@v4 | |
with: | |
path: ~/.rustup | |
key: rust-nightly-${{ runner.os }}-${{ hashFiles('rust-toolchain') }} | |
- name: Install Rust Nightly if Not Cached | |
if: steps.cache-rust-nightly.outputs.cache-hit != 'true' | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
components: rustfmt, clippy | |
# Cache Protoc | |
- name: Cache protoc | |
id: cache-protoc | |
uses: actions/cache@v4 | |
with: | |
path: | | |
/var/cache/apt/archives | |
~/.local/bin/protoc | |
key: protoc-${{ runner.os }}-26.1 | |
- name: Install Latest Protoc if Not Cached | |
if: steps.cache-protoc.outputs.cache-hit != 'true' | |
run: | | |
PROTOC_VERSION=26.1 | |
ARCH=x86_64 | |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip | |
sudo apt-get install -y unzip protobuf-compiler libprotobuf-dev | |
unzip protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -d $HOME/.local | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
protoc --version | |
# Build yellowstone-vixen | |
- name: build yellowstone-vixen | |
run: cargo build --verbose --release |