From 824785fef031ced27883f7b7f63dfab740d415e2 Mon Sep 17 00:00:00 2001 From: Dimach Date: Thu, 25 Jul 2024 18:11:39 +0300 Subject: [PATCH 1/4] Create rust.yml --- .github/workflows/rust.yml | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/rust.yml diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml new file mode 100644 index 0000000..e93b20e --- /dev/null +++ b/.github/workflows/rust.yml @@ -0,0 +1,33 @@ +name: Rust + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +env: + CARGO_TERM_COLOR: always + +jobs: + build-linux: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose + + build-windows: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + - uses: actions-rust-lang/setup-rust-toolchain@v1 + - name: Build + run: cargo build --verbose + - name: Run tests + run: cargo test --verbose From 59904f8e2ef26480e6d3701a65df9edc1f1802d4 Mon Sep 17 00:00:00 2001 From: Dimach Date: Thu, 25 Jul 2024 18:17:43 +0300 Subject: [PATCH 2/4] Ignore dead code --- src/structs.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/structs.rs b/src/structs.rs index 981b705..ca98fb0 100644 --- a/src/structs.rs +++ b/src/structs.rs @@ -133,6 +133,7 @@ impl Decode for EventType { } #[derive(Decode, Copy, Clone, Debug)] +#[allow(dead_code)] pub struct EventZoneBegin { pub thread_id: u32, pub source_location: u32, @@ -140,6 +141,7 @@ pub struct EventZoneBegin { } #[derive(Decode, Copy, Clone, Debug)] +#[allow(dead_code)] pub struct EventZoneEnd { pub thread_id: u32, _padding: u32, @@ -147,6 +149,7 @@ pub struct EventZoneEnd { } #[derive(Decode, Copy, Clone, Debug)] +#[allow(dead_code)] pub struct EventZoneColor { pub thread_id: u32, pub color: [u8; 4], @@ -154,6 +157,7 @@ pub struct EventZoneColor { } #[derive(Decode, Copy, Clone, Debug)] +#[allow(dead_code)] pub struct EventFrameMark { pub name: u32, _padding: u32, @@ -226,6 +230,7 @@ pub struct NetworkHeader { } #[derive(Decode, Debug)] +#[allow(dead_code)] pub struct NetworkQuery { pub query_type: ServerQueryType, pub pointer: u64, From 0e4501598e56924ffa2462ae99aae56ea34d6c56 Mon Sep 17 00:00:00 2001 From: Dimach Date: Thu, 25 Jul 2024 18:28:11 +0300 Subject: [PATCH 3/4] Add artifact build --- .github/workflows/rust.yml | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e93b20e..f95ebe4 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -16,10 +16,16 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Build + - name: Build (Debug) run: cargo build --verbose - name: Run tests run: cargo test --verbose + - name: Build (release) + run: cargo build --target x86_64-unknown-linux-gnu + - uses: actions/upload-artifact@v4 + with: + name: Linux Build + path: target/x86_64-unknown-linux-gnu/release/rtracy build-windows: runs-on: windows-latest @@ -27,7 +33,13 @@ jobs: steps: - uses: actions/checkout@v4 - uses: actions-rust-lang/setup-rust-toolchain@v1 - - name: Build + - name: Build (Debug) run: cargo build --verbose - name: Run tests run: cargo test --verbose + - name: Build (release) + run: cargo build --target x86_64-pc-windows-msvc + - uses: actions/upload-artifact@v4 + with: + name: Windows Build + path: target/x86_64-pc-windows-msvc/release/rtracy.exe \ No newline at end of file From d9074f66bc93d5d7042011d1620088c52089ece4 Mon Sep 17 00:00:00 2001 From: Dimach Date: Thu, 25 Jul 2024 18:31:57 +0300 Subject: [PATCH 4/4] --release --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f95ebe4..ff9147b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -21,7 +21,7 @@ jobs: - name: Run tests run: cargo test --verbose - name: Build (release) - run: cargo build --target x86_64-unknown-linux-gnu + run: cargo build --target x86_64-unknown-linux-gnu --release - uses: actions/upload-artifact@v4 with: name: Linux Build @@ -38,7 +38,7 @@ jobs: - name: Run tests run: cargo test --verbose - name: Build (release) - run: cargo build --target x86_64-pc-windows-msvc + run: cargo build --target x86_64-pc-windows-msvc --release - uses: actions/upload-artifact@v4 with: name: Windows Build