Skip to content

Commit ab7b839

Browse files
authored
ci: Regenerate and verify the supported messages file (#347)
* fix: Update supported message generator to match the last refactoring two years ago. * ci: Regenerate and verify the supported message file in order to enforce congruence between it and its source list. Furthermore drop the generated file from rustfmt ignore as it's apparently currently formatted.
1 parent 3e43663 commit ab7b839

File tree

4 files changed

+23
-2
lines changed

4 files changed

+23
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: CI verify cleanly generated supported message
2+
'on':
3+
workflow_call: null
4+
jobs:
5+
supported_message:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout (GitHub)
9+
uses: actions/checkout@v4
10+
- name: Install dependencies
11+
run: npm install
12+
working-directory: tools/schema/
13+
- name: Regenerate supported message
14+
run: node gen_supported_message
15+
working-directory: tools/schema/
16+
- name: Format generated code
17+
run: rustfmt lib/src/core/supported_message.rs
18+
- name: Verify generated code matches committed code
19+
run: git status --porcelain

.github/workflows/main.yml

+3
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ jobs:
3737
code-coverage:
3838
uses: ./.github/workflows/ci_code_coverage.yml
3939

40+
verify-clean-supported-message:
41+
uses: ./.github/workflows/ci_verify_clean_supported_message.yml
42+
4043
verify-code-formatting:
4144
uses: ./.github/workflows/ci_format_code.yml
4245

rustfmt.toml

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
ignore = [
2-
"core/src/supported_messsages.rs",
32
"server/src/address_space/generated",
43
"types/src/node_ids.rs",
54
"types/src/service_types",

tools/schema/gen_supported_message.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ use crate::types::{
2828
service_types::*,
2929
};
3030
31-
pub use crate::server::comms::tcp_types::AcknowledgeMessage;
31+
pub use crate::core::comms::tcp_types::AcknowledgeMessage;
3232
3333
/// This macro helps avoid tedious repetition as new messages are added
3434
/// The first form just handles the trailing comma after the last entry to save some pointless

0 commit comments

Comments
 (0)