|
| 1 | +name: Merge Requirements |
| 2 | + |
| 3 | +on: [pull_request] |
| 4 | + |
| 5 | +env: |
| 6 | + RUST_BACKTRACE: 1 |
| 7 | + RUSTFLAGS: "-D warnings" |
| 8 | + |
| 9 | +jobs: |
| 10 | + build: |
| 11 | + name: Build |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest, windows-latest, macOS-latest] |
| 16 | + steps: |
| 17 | + - uses: actions/checkout@v4 |
| 18 | + - uses: dtolnay/rust-toolchain@stable |
| 19 | + |
| 20 | + - uses: actions/cache@v4 |
| 21 | + with: |
| 22 | + path: | |
| 23 | + ~/.cargo/bin/ |
| 24 | + ~/.cargo/registry/index/ |
| 25 | + ~/.cargo/registry/cache/ |
| 26 | + ~/.cargo/git/db/ |
| 27 | + target/ |
| 28 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 29 | + |
| 30 | + - name: Build |
| 31 | + run: cargo build --release |
| 32 | + |
| 33 | + checks: |
| 34 | + name: Enforce Clippy constraints |
| 35 | + runs-on: ubuntu-latest |
| 36 | + steps: |
| 37 | + - uses: actions/checkout@v4 |
| 38 | + - uses: dtolnay/rust-toolchain@stable |
| 39 | + with: |
| 40 | + components: clippy |
| 41 | + |
| 42 | + - uses: actions/cache@v4 |
| 43 | + with: |
| 44 | + path: | |
| 45 | + ~/.cargo/bin/ |
| 46 | + ~/.cargo/registry/index/ |
| 47 | + ~/.cargo/registry/cache/ |
| 48 | + ~/.cargo/git/db/ |
| 49 | + target/ |
| 50 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 51 | + |
| 52 | + - name: Run Clippy |
| 53 | + run: cargo clippy --all-targets --all-features |
| 54 | + |
| 55 | + fmt: |
| 56 | + name: Rustfmt |
| 57 | + runs-on: ubuntu-latest |
| 58 | + steps: |
| 59 | + - uses: actions/checkout@v4 |
| 60 | + - uses: dtolnay/rust-toolchain@stable |
| 61 | + with: |
| 62 | + components: rustfmt |
| 63 | + |
| 64 | + - name: Check formatting |
| 65 | + run: cargo fmt --all -- --check |
| 66 | + |
| 67 | + tests: |
| 68 | + name: Test |
| 69 | + runs-on: ubuntu-latest |
| 70 | + steps: |
| 71 | + - uses: actions/checkout@v4 |
| 72 | + - uses: dtolnay/rust-toolchain@stable |
| 73 | + |
| 74 | + - uses: actions/cache@v4 |
| 75 | + with: |
| 76 | + path: | |
| 77 | + ~/.cargo/bin/ |
| 78 | + ~/.cargo/registry/index/ |
| 79 | + ~/.cargo/registry/cache/ |
| 80 | + ~/.cargo/git/db/ |
| 81 | + target/ |
| 82 | + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} |
| 83 | + |
| 84 | + - name: Run tests |
| 85 | + run: cargo test --release |
| 86 | + |
| 87 | + test-publish: |
| 88 | + name: Dry run publish |
| 89 | + runs-on: ubuntu-latest |
| 90 | + steps: |
| 91 | + - uses: actions/checkout@v4 |
| 92 | + - uses: dtolnay/rust-toolchain@stable |
| 93 | + |
| 94 | + - name: Dry run publish |
| 95 | + run: cargo publish --dry-run |
0 commit comments