From 99a96a61971e09ffec67827dfcf5cbae9e43a47f Mon Sep 17 00:00:00 2001 From: Thomas Fossati Date: Thu, 4 Jul 2024 17:21:42 +0200 Subject: [PATCH] feat: add CI actions for OpenAPI and Rust Partially address #3 Signed-off-by: Thomas Fossati --- .github/workflows/openapi.yml | 21 +++++++++++++++++++++ .github/workflows/rust.yml | 29 +++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 .github/workflows/openapi.yml create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/openapi.yml b/.github/workflows/openapi.yml new file mode 100644 index 0000000..7674cc7 --- /dev/null +++ b/.github/workflows/openapi.yml @@ -0,0 +1,21 @@ +name: OpenAPI + +on: + push: + paths: + - 'doc/api/**' + pull_request: + paths: + - 'doc/api/**' + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Install OpenAPI spec validator + run: pip install openapi-spec-validator + - name: Check key-broker API + run: openapi-spec-validator doc/api/keys/keys.yaml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..94dbebc --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,29 @@ +name: Rust + +on: + push: + paths: + - 'rust-keybroker/**' + pull_request + paths: + - 'rust-keybroker/**' + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Formatting checks + run: cargo fmt --manifest-path=rust-keybroker/Cargo.toml --all -- --check + - name: Clippy checks + run: cargo clippy --manifest-path=rust-keybroker/Cargo.toml --all-targets -- -D clippy::all -D clippy::cargo -A clippy::multiple-crate-versions + - name: Build + run: cargo build --manifest-path=rust-keybroker/Cargo.toml --verbose + - name: Run tests + run: cargo test --manifest-path=rust-keybroker/Cargo.toml --verbose