Skip to content

Commit 03a3080

Browse files
Nagaprasadvrkespinola
authored andcommitted
chore : add step to install protoc
1 parent 58de103 commit 03a3080

File tree

3 files changed

+94
-54
lines changed

3 files changed

+94
-54
lines changed

.github/workflows/build-crates.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/build.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Build yellowstone-vixen crates
2+
# This workflow uses github runners.
3+
concurrency:
4+
group: ${{ github.workflow }}-${{ github.ref }}
5+
cancel-in-progress: true
6+
7+
# This may be adjusted to whatever suits best your runners config.
8+
# Current config will build on manual trigger or pull-request (each push)
9+
on:
10+
# pull_request can be removed, to save minutes on github runners
11+
pull_request:
12+
workflow_dispatch:
13+
push:
14+
branches:
15+
- 'main'
16+
17+
env:
18+
CARGO_TERM_COLOR: always
19+
20+
jobs:
21+
build:
22+
# This can be also be runned on self-hosted github runners
23+
runs-on: ubuntu-22.04
24+
25+
steps:
26+
- name: checkout repo
27+
uses: actions/checkout@v4
28+
29+
# This step can be omited, to save storage space on the organization account
30+
# Build process will take longer
31+
- name: Cache Build Dependencies
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.cargo/bin/
36+
~/.cargo/registry/index/
37+
~/.cargo/registry/cache/
38+
~/.cargo/git/db/
39+
yellowstone-vixen/target/
40+
key: cargo-${{ hashFiles('**/Cargo.lock') }}-0001
41+
42+
# Cache Rust Nightly Toolchain
43+
- name: Cache Rust Nightly
44+
id: cache-rust-nightly
45+
uses: actions/cache@v4
46+
with:
47+
path: ~/.rustup
48+
key: rust-nightly-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}
49+
50+
- name: Install Rust Nightly if Not Cached
51+
if: steps.cache-rust-nightly.outputs.cache-hit != 'true'
52+
uses: actions-rs/toolchain@v1
53+
with:
54+
toolchain: nightly
55+
override: true
56+
components: rustfmt, clippy
57+
58+
- name: Install Latest Protoc
59+
run: |
60+
PROTOC_VERSION=26.1
61+
ARCH=x86_64
62+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip
63+
sudo apt-get install -y unzip protobuf-compiler libprotobuf-dev
64+
unzip protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -d $HOME/.local
65+
echo "$HOME/.local/bin" >> $GITHUB_PATH
66+
protoc --version
67+
68+
# Build yellowstone-vixen
69+
- name: build yellowstone-vixen
70+
run: cargo build --verbose --release

.github/workflows/test.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,26 @@
11
name: Check lock file, fmt, clippy
2-
2+
# This workflow uses github runners.
33
concurrency:
44
group: ${{ github.workflow }}-${{ github.ref }}
55
cancel-in-progress: true
66

7+
# This may be adjusted to whatever suits best your runners config.
8+
# Current config will build on manual trigger or pull-request (each push)
79
on:
10+
# pull_request can be removed, to save minutes on github runners
811
pull_request:
912
push:
1013
branches:
1114
- 'main'
1215
workflow_dispatch:
13-
1416
env:
1517
CARGO_TERM_COLOR: always
16-
1718
jobs:
1819
test:
1920
runs-on: ubuntu-22.04
20-
2121
steps:
2222
- name: checkout repo
2323
uses: actions/checkout@v4
24-
2524
- name: set build cache
2625
uses: actions/cache@v4
2726
with:
@@ -33,14 +32,32 @@ jobs:
3332
yellowstone-vixen/target/
3433
key: cargo-${{ hashFiles('**/Cargo.lock') }}-0001
3534

36-
# Install Rust Nightly
37-
- name: Install Rust Nightly
35+
# Cache Rust Nightly Toolchain
36+
- name: Cache Rust Nightly
37+
id: cache-rust-nightly
38+
uses: actions/cache@v4
39+
with:
40+
path: ~/.rustup
41+
key: rust-nightly-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}
42+
43+
- name: Install Rust Nightly if Not Cached
44+
if: steps.cache-rust-nightly.outputs.cache-hit != 'true'
3845
uses: actions-rs/toolchain@v1
3946
with:
4047
toolchain: nightly
4148
override: true
4249
components: rustfmt, clippy
4350

51+
- name: Install Latest Protoc
52+
run: |
53+
PROTOC_VERSION=26.1
54+
ARCH=x86_64
55+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip
56+
sudo apt-get install -y unzip protobuf-compiler libprotobuf-dev
57+
unzip protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -d $HOME/.local
58+
echo "$HOME/.local/bin" >> $GITHUB_PATH
59+
protoc --version
60+
4461
# Cargo.lock
4562
- name: Check lock file
4663
run: |

0 commit comments

Comments
 (0)