Skip to content

gha: add basic lint & build jobs #6

gha: add basic lint & build jobs

gha: add basic lint & build jobs #6

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
env:
RUSTFLAGS: "-Dwarnings"
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
components: rustfmt, clippy
- name: Install build dependencies
run: |
sudo apt-get update
sudo apt -y install \
autoconf-archive \
libcmocka0 \
libcmocka-dev \
procps \
iproute2 \
build-essential \
git \
pkg-config \
gcc \
libtool \
automake \
libssl-dev \
uthash-dev \
autoconf \
doxygen \
libjson-c-dev \
libini-config-dev \
libcurl4-openssl-dev \
uuid-dev \
libltdl-dev \
libusb-1.0-0-dev \
libftdi-dev
- name: Clone tpm2-tss repository
run: |
git clone https://github.com/tpm2-software/tpm2-tss.git
cd tpm2-tss
git checkout 4.1.3
- name: Build and install tpm2-tss
run: |
cd tpm2-tss
./bootstrap
./configure --prefix=/usr/local
make -j$(nproc)
sudo make install
sudo ldconfig
- name: Cargo fmt
run: cargo fmt --check
- name: Clippy
run: cargo clippy --all-targets --all-features
build:
runs-on: ubuntu-latest
needs: [lint]
steps:
- uses: actions/checkout@v5
- name: Setup Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
libtss2-dev \
tpm2-tss \
pkg-config
- name: Build
run: cargo build