feat: add github workflows for building and checking fmt..
#8
This file contains hidden or 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: Check lock file, fmt, clippy | ||
| # 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: | ||
| push: | ||
| branches: | ||
| - 'main' | ||
| workflow_dispatch: | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| jobs: | ||
| test: | ||
| needs: pre-req # Ensure pre-req runs first | ||
| runs-on: ubuntu-22.04 | ||
| steps: | ||
| - name: checkout repo | ||
| uses: actions/checkout@v4 | ||
| - name: set build cache | ||
| 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 | ||
| # Download protoc Artifact from pre-req.yml | ||
| - name: Download protoc Artifact | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: protoc | ||
| path: ~/.local/bin | ||
| # Set up Protoc Path | ||
| - name: Set up protoc Path | ||
| run: echo "$HOME/.local/bin" >> $GITHUB_PATH | ||
| # Verify Protoc Installation | ||
| - name: Verify Protoc Version | ||
| run: protoc --version | ||
| # Cargo.lock | ||
| - name: Check lock file | ||
| run: | | ||
| cargo tree | ||
| git checkout Cargo.lock | ||
| cargo tree --frozen | ||
| # fmt | ||
| - name: Check fmt | ||
| run: cargo +nightly fmt --all -- --check | ||
| # clippy | ||
| - name: Check clippy | ||
| run: cargo +nightly clippy --all-targets --tests -- -Dwarnings | ||