From 5e8b6613655759b2699000699619aa5300ee2f18 Mon Sep 17 00:00:00 2001 From: Jan-Niklas Burfeind Date: Tue, 23 Jul 2024 20:16:18 +0200 Subject: [PATCH] ci: Regenerate and verify the address space files (#348) in order to enforce congruence between it and the source nodeset. Furthermore drop the generated file from rustfmt ignore as it's apparently currently formatted. --- .../ci_verify_clean_address_space.yml | 20 +++++++++++++++++++ .github/workflows/main.yml | 3 +++ rustfmt.toml | 1 - 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/ci_verify_clean_address_space.yml diff --git a/.github/workflows/ci_verify_clean_address_space.yml b/.github/workflows/ci_verify_clean_address_space.yml new file mode 100644 index 000000000..56f83d179 --- /dev/null +++ b/.github/workflows/ci_verify_clean_address_space.yml @@ -0,0 +1,20 @@ +name: CI verify cleanly generated address space +'on': + workflow_call: null +jobs: + address_space: + runs-on: ubuntu-latest + steps: + - name: Checkout (GitHub) + uses: actions/checkout@v4 + - name: Install dependencies + run: npm install + working-directory: tools/schema/ + - name: Regenerate address space + run: node gen_address_space + working-directory: tools/schema/ + - name: Format generated code + # This invokes formatting of all nodeset children as well. + run: rustfmt lib/src/server/address_space/generated/mod.rs + - name: Verify generated code matches committed code + run: git status --porcelain diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 57b21f538..76d86d525 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -51,6 +51,9 @@ jobs: code-coverage: uses: ./.github/workflows/ci_code_coverage.yml + verify-clean-address-space: + uses: ./.github/workflows/ci_verify_clean_address_space.yml + verify-clean-supported-message: uses: ./.github/workflows/ci_verify_clean_supported_message.yml diff --git a/rustfmt.toml b/rustfmt.toml index 2ae2d8845..3630d980a 100644 --- a/rustfmt.toml +++ b/rustfmt.toml @@ -1,5 +1,4 @@ ignore = [ - "server/src/address_space/generated", "types/src/node_ids.rs", "types/src/service_types", ]