|
| 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 |
0 commit comments