Skip to content

⬆️ Update Rust crate axum πŸ”€ #856

⬆️ Update Rust crate axum πŸ”€

⬆️ Update Rust crate axum πŸ”€ #856

Workflow file for this run

# This file contains the CI workflow for the Mochi project.
# For simplicity we are compiling and testing everything on the Ubuntu environment only.
name: Mochi CI
env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1
CARGO_REGISTRY_DIR: ~/.cargo/registry
on:
workflow_dispatch: # Allows manual execution
push:
branches: [ main ]
paths-ignore:
- '**.md'
- 'docs/**'
pull_request:
branches: [ main ]
types: [opened, synchronize, reopened]
paths-ignore:
- '**.md'
- 'docs/**'
# Avoid concurrent executions
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: πŸ” Check
runs-on: ubuntu-latest
steps:
- name: πŸ“₯ Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: πŸ¦€ Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: πŸ” Run cargo check
run: |
echo "πŸ” Running cargo check..."
cargo check
echo "βœ… Cargo check completed successfully!"
test:
name: πŸ§ͺ Test Suite
needs: check
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-tests]') }}
steps:
- name: πŸ“₯ Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: πŸ¦€ Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: πŸ§ͺ Run cargo test
run: |
echo "πŸ§ͺ Starting test suite execution..."
cargo test
echo "βœ… All tests passed successfully!"
clippy:
name: πŸ”¬ Clippy
needs: check
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-clippy]') }}
steps:
- name: πŸ“₯ Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: πŸ¦€ Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- name: πŸ”¬ Run cargo clippy
run: |
echo "πŸ”¬ Running Clippy analysis..."
cargo clippy
echo "βœ… Clippy checks passed!"
fmt:
name: πŸ“ Format
needs: check
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[skip-fmt]') }}
steps:
- name: πŸ“₯ Checkout sources
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
- name: πŸ¦€ Install stable toolchain
uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt
- name: πŸ“ Run cargo fmt
run: |
echo "πŸ“ Checking code formatting..."
cargo fmt --all -- --check
echo "βœ… Code formatting check passed!"
# Summary job that runs even if some jobs are skipped
pipeline-summary:
name: πŸ“‹ Pipeline Summary
needs: [check, test, clippy, fmt]
runs-on: ubuntu-latest
if: always()
steps:
- name: πŸ“Š Generate Pipeline Summary
run: |
echo "## 🍑 Mochi CI Pipeline Summary" >> $GITHUB_STEP_SUMMARY
echo "" >> $GITHUB_STEP_SUMMARY
# List skipped steps
if [[ "${{ contains(github.event.head_commit.message, '[skip-fmt]') }}" == "true" ]]; then
echo "⏭️ Format check was skipped via [skip-fmt]" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ contains(github.event.head_commit.message, '[skip-clippy]') }}" == "true" ]]; then
echo "⏭️ Clippy analysis was skipped via [skip-clippy]" >> $GITHUB_STEP_SUMMARY
fi
if [[ "${{ contains(github.event.head_commit.message, '[skip-tests]') }}" == "true" ]]; then
echo "⏭️ Tests were skipped via [skip-tests]" >> $GITHUB_STEP_SUMMARY
fi
# Add job status summary
echo "" >> $GITHUB_STEP_SUMMARY
echo "### πŸ“ˆ Job Status" >> $GITHUB_STEP_SUMMARY
echo "* πŸ” Check: ${{ needs.check.result }}" >> $GITHUB_STEP_SUMMARY
echo "* πŸ§ͺ Tests: ${{ needs.test.result || 'Skipped' }}" >> $GITHUB_STEP_SUMMARY
echo "* πŸ”¬ Clippy: ${{ needs.clippy.result || 'Skipped' }}" >> $GITHUB_STEP_SUMMARY
echo "* πŸ“ Format: ${{ needs.fmt.result || 'Skipped' }}" >> $GITHUB_STEP_SUMMARY