Skip to content

add GH workflow for rust pr checks #1

add GH workflow for rust pr checks

add GH workflow for rust pr checks #1

Workflow file for this run

---
name: PR checks for rust server backend
on:
pull_request:
push:
concurrency:
group: '${{ github.workflow }} @ ${{ github.head_ref || github.ref }}'
cancel-in-progress: true
jobs:
changed-files:
name: Check changes for rust server app
runs-on: minafoundation-toolchain-jammy-runners
steps:
- name: 📥 Checkout
uses: actions/checkout@v4
- uses: tj-actions/changed-files@v39
id: changed
with:
files_yaml: |
server:
- 'server/**'
write_output_files: true
outputs:
modified_keys: ${{ steps.changed.outputs.modified_keys }}
rust-checks:
if: needs.changed-files.outputs.modified_keys != '[]' && needs.changed-files.outputs.modified_keys != ''
name: Rust PR Checks
runs-on: minafoundation-toolchain-jammy-runners
strategy:
matrix:
# In case in the future we want to add beta/nightly
toolchain: [stable]
steps:
- uses: actions/checkout@v4
- name: Install ${{ matrix.toolchain }}
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.toolchain }}
- name: ✍️ Check formatting
run: cargo fmt --all -- --check
- name: 🧐 Check linting
run: cargo clippy -- -D warnings -D clippy::unwrap_used
- name: 🏗️ Build the app
run: cargo build --release
- name: 📋 Run the tests
run: cargo test --locked --all-features --all-targets