|
| 1 | +name: CI |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + pull_request: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +env: |
| 12 | + RUSTFLAGS: "-Dwarnings" |
| 13 | + DATABASE_URL: "sqlite:patela.db" |
| 14 | + |
| 15 | +jobs: |
| 16 | + lint: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + container: debian:13-slim |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v5 |
| 21 | + - name: Install dependencies |
| 22 | + run: | |
| 23 | + apt-get update && apt-get install -y \ |
| 24 | + libtss2-dev \ |
| 25 | + libmnl-dev \ |
| 26 | + libnftnl-dev \ |
| 27 | + curl \ |
| 28 | + build-essential \ |
| 29 | + pkg-config \ |
| 30 | + git \ |
| 31 | + ca-certificates |
| 32 | + - name: Setup rust |
| 33 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 34 | + with: |
| 35 | + toolchain: stable |
| 36 | + components: rustfmt, clippy |
| 37 | + - name: Cargo fmt |
| 38 | + uses: actions-rs/cargo@v1 |
| 39 | + with: |
| 40 | + command: fmt |
| 41 | + args: --all -- --check |
| 42 | + - name: Install sqlx-cli |
| 43 | + uses: actions-rs/cargo@v1 |
| 44 | + with: |
| 45 | + command: install |
| 46 | + args: sqlx-cli --no-default-features --features sqlite |
| 47 | + - name: Prepare DB |
| 48 | + run: | |
| 49 | + cargo sqlx database create |
| 50 | + cargo sqlx database setup --source server/migrations |
| 51 | + - name: Clippy |
| 52 | + uses: actions-rs/cargo@v1 |
| 53 | + with: |
| 54 | + command: clippy |
| 55 | + args: --all-targets --all-features |
| 56 | + |
| 57 | + build: |
| 58 | + runs-on: ubuntu-latest |
| 59 | + needs: [lint] |
| 60 | + steps: |
| 61 | + - uses: actions/checkout@v5 |
| 62 | + - name: Install dependencies |
| 63 | + run: | |
| 64 | + apt-get update && apt-get install -y \ |
| 65 | + libtss2-dev \ |
| 66 | + libmnl-dev \ |
| 67 | + libnftnl-dev \ |
| 68 | + curl \ |
| 69 | + build-essential \ |
| 70 | + pkg-config \ |
| 71 | + git \ |
| 72 | + ca-certificates |
| 73 | + - name: Setup rust |
| 74 | + uses: actions-rust-lang/setup-rust-toolchain@v1 |
| 75 | + with: |
| 76 | + toolchain: stable |
| 77 | + components: rustfmt, clippy |
| 78 | + - name: Install sqlx-cli |
| 79 | + uses: actions-rs/cargo@v1 |
| 80 | + with: |
| 81 | + command: install |
| 82 | + args: sqlx-cli --no-default-features --features sqlite |
| 83 | + - name: Prepare DB |
| 84 | + run: | |
| 85 | + cargo sqlx database create |
| 86 | + cargo sqlx database setup --source server/migrations |
| 87 | + - name: Build |
| 88 | + uses: actions-rs/cargo@v1 |
| 89 | + with: |
| 90 | + command: build |
0 commit comments