Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Regenerate and verify the supported messages file #347

Merged
merged 2 commits into from
Jul 23, 2024
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
19 changes: 19 additions & 0 deletions .github/workflows/ci_verify_clean_supported_message.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI verify cleanly generated supported message
'on':
workflow_call: null
jobs:
supported_message:
runs-on: ubuntu-latest
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
working-directory: tools/schema/
- name: Regenerate supported message
run: node gen_supported_message
working-directory: tools/schema/
- name: Format generated code
run: rustfmt lib/src/core/supported_message.rs
- name: Verify generated code matches committed code
run: git status --porcelain
3 changes: 3 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,8 @@ jobs:
code-coverage:
uses: ./.github/workflows/ci_code_coverage.yml

verify-clean-supported-message:
uses: ./.github/workflows/ci_verify_clean_supported_message.yml

verify-code-formatting:
uses: ./.github/workflows/ci_format_code.yml
1 change: 0 additions & 1 deletion rustfmt.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ignore = [
"core/src/supported_messsages.rs",
"server/src/address_space/generated",
"types/src/node_ids.rs",
"types/src/service_types",
Expand Down
2 changes: 1 addition & 1 deletion tools/schema/gen_supported_message.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ use crate::types::{
service_types::*,
};

pub use crate::server::comms::tcp_types::AcknowledgeMessage;
pub use crate::core::comms::tcp_types::AcknowledgeMessage;

/// This macro helps avoid tedious repetition as new messages are added
/// The first form just handles the trailing comma after the last entry to save some pointless
Expand Down
Loading