Skip to content

Commit

Permalink
[ISSUE #11]Update ci.yml (#12)
Browse files Browse the repository at this point in the history
* [ISSUE #11]Update ci.yml

* fix ci error

* fix ci

* fix ci error
  • Loading branch information
mxsm authored Dec 30, 2023
1 parent 42ed371 commit 1f30410
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 90 deletions.
109 changes: 28 additions & 81 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,99 +1,46 @@
name: 'CI'
name: CI
on:
pull_request:
push:
branches:
- main

branches: [ "main" ]
pull_request:
branches: [ "main"]
env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
CI: true

jobs:
ci-pass:
name: CI is green
build:
runs-on: ubuntu-latest
needs:
- test-linux
- test-linux-aarch64
- test-macos
- test-windows
- lint
steps:
- run: exit 0

test-linux:
runs-on: [self-hosted, X64]
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
rust: [nightly]

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
cargo build
- name: Checkout code
uses: actions/checkout@v2

test-linux-aarch64:
runs-on: [self-hosted, arm]

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
components: rustfmt
# - uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
cargo build
override: true
toolchain: ${{ matrix.rust }}

test-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Run tests
- name: Install dependencies
run: |
cargo check
cargo test
cargo build
rustup component add rustfmt
rustup component add clippy
test-windows:
runs-on: windows-latest
- name: Format check
run: cargo fmt -- --check

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt
- uses: Swatinem/rust-cache@v1
- name: Run tests
run: |
cargo check
cargo test
cargo build
- name: Clippy check
run: cargo clippy -- -D warnings

lint:
runs-on: [self-hosted, X64]
- name: Build
run: cargo build --verbose

steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@nightly
with:
components: rustfmt, clippy
# - uses: Swatinem/rust-cache@v1
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Format check
run: |
cargo fmt -- --check
- name: Test
run: cargo test --verbose
2 changes: 1 addition & 1 deletion common/src/common/mq_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1879,4 +1879,4 @@ pub enum RocketMqVersion {
mod tests {
#[test]
fn test_version_from_str() {}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use crate::protocol::{
RemotingSerializable,
};

#[derive(Debug, Serialize, Deserialize, Clone)]
#[derive(Default)]
#[derive(Debug, Serialize, Deserialize, Clone, Default)]
pub struct RegisterBrokerBody {
#[serde(rename = "topicConfigSerializeWrapper")]
topic_config_serialize_wrapper: TopicConfigAndMappingSerializeWrapper,
Expand All @@ -52,7 +51,6 @@ impl RegisterBrokerBody {
}
}


impl RegisterBrokerBody {
pub fn decode(
bytes: &Bytes,
Expand Down
5 changes: 1 addition & 4 deletions remoting/src/protocol/body/topic_info_wrapper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ use crate::protocol::{DataVersion, RemotingSerializable};

pub mod topic_config_wrapper;

#[derive(Debug, Deserialize, Serialize)]
#[derive(Default)]
#[derive(Debug, Deserialize, Serialize, Default)]
pub struct TopicConfigSerializeWrapper {
#[serde(rename = "topicConfigTable")]
topic_config_table: Option<HashMap<String, TopicConfig>>,
Expand All @@ -34,8 +33,6 @@ pub struct TopicConfigSerializeWrapper {
data_version: Option<DataVersion>,
}



impl RemotingSerializable for TopicConfigSerializeWrapper {
type Output = Self;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use serde::{Deserialize, Serialize};

use crate::protocol::static_topic::logic_queue_mapping_item::LogicQueueMappingItem;

#[derive(Debug, Clone, Serialize, Deserialize,Default)]
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
pub struct TopicQueueMappingDetail {
#[serde(rename = "hostedQueues")]
hosted_queues: Option<HashMap<i32 /* global id */, Vec<LogicQueueMappingItem>>>,
Expand Down

0 comments on commit 1f30410

Please sign in to comment.