Skip to content

Commit ac6dbdb

Browse files
committed
chore : add step to install protoc
1 parent 08faa06 commit ac6dbdb

File tree

2 files changed

+74
-37
lines changed

2 files changed

+74
-37
lines changed

.github/workflows/run.yml renamed to .github/workflows/build.yml

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -49,47 +49,20 @@ jobs:
4949
id: cache-protoc
5050
uses: actions/cache@v4
5151
with:
52-
path: /usr/local/bin/protoc
53-
key: protoc-${{ runner.os }}-latest
52+
path: ~/.local/bin/protoc
53+
key: protoc-${{ runner.os }}-26.1
5454

55-
- name: Install protoc if not cached
55+
- name: Install Latest Protoc if Not Cached
5656
if: steps.cache-protoc.outputs.cache-hit != 'true'
5757
run: |
58-
sudo apt-get update
59-
sudo apt-get install -y protobuf-compiler
60-
protoc --version # Verify installation
58+
PROTOC_VERSION=26.1
59+
ARCH=x86_64
60+
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v${PROTOC_VERSION}/protoc-${PROTOC_VERSION}-linux-${ARCH}.zip
61+
sudo apt-get install -y unzip
62+
unzip protoc-${PROTOC_VERSION}-linux-${ARCH}.zip -d $HOME/.local
63+
echo "$HOME/.local/bin" >> $GITHUB_PATH
64+
protoc --version
6165
6266
# Build yellowstone-vixen
6367
- name: build yellowstone-vixen
6468
run: cargo build --verbose --release
65-
66-
# Use cache or Install Rust Nightly
67-
- name: Cache Rust Nightly
68-
id: cache-rust-nightly
69-
uses: actions/cache@v4
70-
with:
71-
path: ~/.rustup
72-
key: rust-nightly-${{ runner.os }}-${{ hashFiles('rust-toolchain') }}
73-
74-
- name: Install Rust Nightly if Not Cached
75-
if: steps.cache-rust-nightly.outputs.cache-hit != 'true'
76-
uses: actions-rs/toolchain@v1
77-
with:
78-
toolchain: nightly
79-
override: true
80-
components: rustfmt, clippy
81-
82-
# Cargo.lock
83-
- name: Check lock file
84-
run: |
85-
cargo tree
86-
git checkout Cargo.lock
87-
cargo tree --frozen
88-
89-
# fmt
90-
- name: Check fmt
91-
run: cargo +nightly fmt --all -- --check
92-
93-
# clippy
94-
- name: Check clippy
95-
run: cargo +nightly clippy --all-targets --tests -- -Dwarnings

.github/workflows/test.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Check lock file, fmt, clippy
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+
push:
13+
branches:
14+
- 'main'
15+
workflow_dispatch:
16+
env:
17+
CARGO_TERM_COLOR: always
18+
jobs:
19+
test:
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- name: checkout repo
23+
uses: actions/checkout@v4
24+
- name: set build cache
25+
uses: actions/cache@v4
26+
with:
27+
path: |
28+
~/.cargo/bin/
29+
~/.cargo/registry/index/
30+
~/.cargo/registry/cache/
31+
~/.cargo/git/db/
32+
yellowstone-vixen/target/
33+
key: cargo-${{ hashFiles('**/Cargo.lock') }}-0001
34+
35+
#- name: Cache Rust Nightly
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'
45+
uses: actions-rs/toolchain@v1
46+
with:
47+
toolchain: nightly
48+
override: true
49+
components: rustfmt, clippy
50+
51+
# Cargo.lock
52+
- name: Check lock file
53+
run: |
54+
cargo tree
55+
git checkout Cargo.lock
56+
cargo tree --frozen
57+
58+
# fmt
59+
- name: Check fmt
60+
run: cargo +nightly fmt --all -- --check
61+
62+
# clippy
63+
- name: Check clippy
64+
run: cargo +nightly clippy --all-targets --tests -- -Dwarnings

0 commit comments

Comments
 (0)