|
21 | 21 | - "**/.config/**" |
22 | 22 |
|
23 | 23 | jobs: |
24 | | - core: |
25 | | - uses: blackportal-ai/infra/.github/workflows/core.yml@master |
| 24 | + clippy: |
| 25 | + name: Clippy |
| 26 | + runs-on: ubuntu-latest |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v4.2.2 |
| 30 | + |
| 31 | + - name: Install Rust |
| 32 | + uses: actions-rs/toolchain@v1.0.6 |
| 33 | + with: |
| 34 | + profile: minimal |
| 35 | + toolchain: stable |
| 36 | + override: true |
| 37 | + |
| 38 | + - name: Cache Cargo Dependencies |
| 39 | + uses: actions/cache@v4.2.1 |
| 40 | + with: |
| 41 | + path: | |
| 42 | + ~/.cargo |
| 43 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 44 | + |
| 45 | + - name: Run Clippy |
| 46 | + run: cargo clippy --all-features --workspace -- -D warnings |
| 47 | + |
| 48 | + rustfmt: |
| 49 | + name: Rustfmt |
| 50 | + runs-on: ubuntu-24.04 |
| 51 | + steps: |
| 52 | + - name: Checkout repository |
| 53 | + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 |
| 54 | + with: |
| 55 | + persist-credentials: false |
| 56 | + - name: Install Rust toolchain |
| 57 | + uses: actions-rust-lang/setup-rust-toolchain@b38f618be2096d3fc834d239085766ecdc8f4b62 |
| 58 | + with: |
| 59 | + components: rustfmt |
| 60 | + - name: Check formatting |
| 61 | + run: cargo fmt --all --check |
| 62 | + |
| 63 | + test: |
| 64 | + name: Tests |
| 65 | + runs-on: ubuntu-latest |
| 66 | + needs: clippy |
| 67 | + |
| 68 | + steps: |
| 69 | + - uses: actions/checkout@v4.2.2 |
| 70 | + |
| 71 | + - name: Install Rust |
| 72 | + uses: actions-rs/toolchain@v1.0.6 |
| 73 | + with: |
| 74 | + profile: minimal |
| 75 | + toolchain: stable |
| 76 | + |
| 77 | + - name: Cache Cargo Dependencies |
| 78 | + uses: actions/cache@v4.2.1 |
| 79 | + with: |
| 80 | + path: | |
| 81 | + ~/.cargo |
| 82 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 83 | + |
| 84 | + - name: Run Tests |
| 85 | + run: cargo test --all-features --workspace |
| 86 | + |
| 87 | + coverage: |
| 88 | + name: Code Coverage |
| 89 | + runs-on: ubuntu-latest |
| 90 | + needs: test |
| 91 | + |
| 92 | + steps: |
| 93 | + - uses: actions/checkout@v4.2.2 |
| 94 | + |
| 95 | + - name: Install Rust |
| 96 | + uses: actions-rs/toolchain@v1.0.6 |
| 97 | + with: |
| 98 | + profile: minimal |
| 99 | + toolchain: stable |
| 100 | + |
| 101 | + - name: Install Tarpaulin |
| 102 | + run: cargo install cargo-tarpaulin |
| 103 | + |
| 104 | + - name: Run Coverage |
| 105 | + run: cargo tarpaulin --out Html |
| 106 | + |
| 107 | + - name: Upload Coverage Report |
| 108 | + uses: actions/upload-artifact@v4.6.1 |
| 109 | + with: |
| 110 | + name: coverage-report |
| 111 | + path: ./tarpaulin-report.html |
0 commit comments