Skip to content

Commit 95ca410

Browse files
authored
Merge pull request #5 from osservatorionessuno/gha
gha: add basic lint & build jobs
2 parents a83aa0f + 2d406dd commit 95ca410

File tree

2 files changed

+95
-3
lines changed

2 files changed

+95
-3
lines changed

.github/workflows/ci.yaml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
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: dtolnay/rust-toolchain@stable
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+
container: debian:13-slim
60+
needs: [lint]
61+
steps:
62+
- uses: actions/checkout@v5
63+
- name: Install dependencies
64+
run: |
65+
apt-get update && apt-get install -y \
66+
libtss2-dev \
67+
libmnl-dev \
68+
libnftnl-dev \
69+
curl \
70+
build-essential \
71+
pkg-config \
72+
git \
73+
ca-certificates
74+
- name: Setup rust
75+
uses: dtolnay/rust-toolchain@stable
76+
with:
77+
toolchain: stable
78+
components: rustfmt, clippy
79+
- name: Install sqlx-cli
80+
uses: actions-rs/cargo@v1
81+
with:
82+
command: install
83+
args: sqlx-cli --no-default-features --features sqlite
84+
- name: Prepare DB
85+
run: |
86+
cargo sqlx database create
87+
cargo sqlx database setup --source server/migrations
88+
- name: Build
89+
uses: actions-rs/cargo@v1
90+
with:
91+
command: build

server/src/main.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,10 @@ async fn auth(
252252
debug!("Incoming ak name {}", ak_name_hex);
253253

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

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

0 commit comments

Comments
 (0)