Merge pull request #10 from Rindrics/tagpr-from-v0.0.0 #34
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: CI | |
| on: | |
| push: | |
| branches: ["**"] | |
| pull_request: | |
| branches: [main] | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| env: | |
| RUST_BACKTRACE: 1 | |
| CARGO_TERM_COLOR: always | |
| permissions: | |
| contents: read | |
| jobs: | |
| quality: | |
| name: Code Quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| with: | |
| components: rustfmt, clippy | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| - name: Check formatting | |
| run: make check-fmt | |
| - name: Run clippy | |
| run: make clippy | |
| test: | |
| name: Test (${{ matrix.os }}) | |
| needs: quality | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [ubuntu-latest, macos-latest] | |
| rust: [stable] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: ${{ matrix.rust }} | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| with: | |
| cache-on-failure: true | |
| key: ${{ matrix.os }}-${{ matrix.rust }} | |
| - name: Build | |
| run: cargo build | |
| - name: Run tests | |
| run: make test | |
| env: | |
| SENDGRID_API_KEY: ${{ secrets.SENDGRID_API_KEY || 'dummy_key_for_ci_testing' }} | |
| EMAIL_FROM_ADDRESS: ci-test@example.com | |
| build-check: | |
| name: Build Check (Release) | |
| needs: quality | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@stable | |
| - name: Setup Rust cache | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Build release binary | |
| run: make build | |
| - name: Check binary size | |
| run: | | |
| ls -lh target/release/ppap | |
| echo "Binary size: $(du -h target/release/ppap | cut -f1)" |