Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

env:
RUSTFLAGS: "-Dwarnings"
DATABASE_URL: "sqlite:patela.db"

jobs:
lint:
runs-on: ubuntu-latest
container: debian:13-slim
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: |
apt-get update && apt-get install -y \
libtss2-dev \
libmnl-dev \
libnftnl-dev \
curl \
build-essential \
pkg-config \
git \
ca-certificates
- name: Setup rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Install sqlx-cli
uses: actions-rs/cargo@v1
with:
command: install
args: sqlx-cli --no-default-features --features sqlite
- name: Prepare DB
run: |
cargo sqlx database create
cargo sqlx database setup --source server/migrations
- name: Clippy
uses: actions-rs/cargo@v1
with:
command: clippy
args: --all-targets --all-features

build:
runs-on: ubuntu-latest
container: debian:13-slim
needs: [lint]
steps:
- uses: actions/checkout@v5
- name: Install dependencies
run: |
apt-get update && apt-get install -y \
libtss2-dev \
libmnl-dev \
libnftnl-dev \
curl \
build-essential \
pkg-config \
git \
ca-certificates
- name: Setup rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
components: rustfmt, clippy
- name: Install sqlx-cli
uses: actions-rs/cargo@v1
with:
command: install
args: sqlx-cli --no-default-features --features sqlite
- name: Prepare DB
run: |
cargo sqlx database create
cargo sqlx database setup --source server/migrations
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
7 changes: 4 additions & 3 deletions server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ async fn auth(
debug!("Incoming ak name {}", ak_name_hex);

// Get or create node by matching all three TPM values (EK, AK public, AK name)
let (node, created) = get_or_create_node_by_ek(&app.db, &ek_public_hex, &ak_public_hex, &ak_name_hex)
.await
.map_err(ErrorInternalServerError)?;
let (node, created) =
get_or_create_node_by_ek(&app.db, &ek_public_hex, &ak_public_hex, &ak_name_hex)
.await
.map_err(ErrorInternalServerError)?;

if created {
info!("Created new node {}", node.id);
Expand Down