Skip to content

Commit 236e4d8

Browse files
committed
CI updates, update deny.toml, clippy fix
1 parent b900ae5 commit 236e4d8

File tree

4 files changed

+34
-20
lines changed

4 files changed

+34
-20
lines changed

.github/workflows/build.yaml

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ on:
99
workflow_dispatch:
1010

1111
env:
12+
BUILD_PROFILE: release-lto
1213
CARGO_BIN_NAME: objdiff
1314
CARGO_TARGET_DIR: target
1415

@@ -30,9 +31,25 @@ jobs:
3031
with:
3132
components: rustfmt, clippy
3233
- name: Cargo check
33-
run: cargo check --all-features
34+
run: cargo check
3435
- name: Cargo clippy
35-
run: cargo clippy --all-features
36+
run: cargo clippy
37+
38+
fmt:
39+
name: Format
40+
runs-on: ubuntu-latest
41+
env:
42+
RUSTFLAGS: -D warnings
43+
steps:
44+
- name: Checkout
45+
uses: actions/checkout@v3
46+
- name: Setup Rust toolchain
47+
# We use nightly options in rustfmt.toml
48+
uses: dtolnay/rust-toolchain@nightly
49+
with:
50+
components: rustfmt
51+
- name: Cargo fmt
52+
run: cargo fmt --all --check
3653

3754
deny:
3855
name: Deny
@@ -52,6 +69,7 @@ jobs:
5269

5370
test:
5471
name: Test
72+
if: 'false' # No tests yet
5573
strategy:
5674
matrix:
5775
platform: [ ubuntu-latest, windows-latest, macos-latest ]
@@ -68,7 +86,7 @@ jobs:
6886
- name: Setup Rust toolchain
6987
uses: dtolnay/rust-toolchain@stable
7088
- name: Cargo test
71-
run: cargo test --release --all-features
89+
run: cargo test --release
7290

7391
build:
7492
name: Build
@@ -103,16 +121,16 @@ jobs:
103121
with:
104122
targets: ${{ matrix.target }}
105123
- name: Cargo build
106-
run: cargo build --release --all-features --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }}
124+
run: cargo build --profile ${{ env.BUILD_PROFILE }} --target ${{ matrix.target }} --bin ${{ env.CARGO_BIN_NAME }}
107125
- name: Upload artifacts
108126
uses: actions/upload-artifact@v3
109127
with:
110128
name: ${{ matrix.name }}
111129
path: |
112-
${{ env.CARGO_TARGET_DIR }}/release/${{ env.CARGO_BIN_NAME }}
113-
${{ env.CARGO_TARGET_DIR }}/release/${{ env.CARGO_BIN_NAME }}.exe
114-
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/${{ env.CARGO_BIN_NAME }}
115-
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/release/${{ env.CARGO_BIN_NAME }}.exe
130+
${{ env.CARGO_TARGET_DIR }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}
131+
${{ env.CARGO_TARGET_DIR }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe
132+
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}
133+
${{ env.CARGO_TARGET_DIR }}/${{ matrix.target }}/${{ env.BUILD_PROFILE }}/${{ env.CARGO_BIN_NAME }}.exe
116134
if-no-files-found: error
117135

118136
release:
@@ -129,8 +147,8 @@ jobs:
129147
working-directory: artifacts
130148
run: |
131149
mkdir ../out
132-
for i in */*/release/$CARGO_BIN_NAME*; do
133-
mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/release\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")"
150+
for i in */*/$BUILD_PROFILE/$CARGO_BIN_NAME*; do
151+
mv "$i" "../out/$(sed -E "s/([^/]+)\/[^/]+\/$BUILD_PROFILE\/($CARGO_BIN_NAME)/\2-\1/" <<< "$i")"
134152
done
135153
ls -R ../out
136154
- name: Release

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ A local diffing tool for decompilation projects.
1313
publish = false
1414
build = "build.rs"
1515

16-
[profile.release]
16+
[profile.release-lto]
17+
inherits = "release"
1718
lto = "thin"
1819
strip = "debuginfo"
1920

deny.toml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,7 @@ yanked = "warn"
4747
notice = "warn"
4848
# A list of advisory IDs to ignore. Note that ignored advisories will still
4949
# output a note when they are encountered.
50-
ignore = [
51-
"RUSTSEC-2023-0022",
52-
"RUSTSEC-2023-0023",
53-
"RUSTSEC-2023-0024",
54-
"RUSTSEC-2023-0034",
55-
"RUSTSEC-2023-0044",
56-
]
50+
ignore = []
5751
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
5852
# lower than the range specified will be ignored. Note that ignored advisories
5953
# will still output a note when they are encountered.
@@ -76,6 +70,7 @@ unlicensed = "deny"
7670
allow = [
7771
"MIT",
7872
"Apache-2.0",
73+
"Apache-2.0 WITH LLVM-exception",
7974
"ISC",
8075
"BSD-2-Clause",
8176
"BSD-3-Clause",
@@ -159,7 +154,7 @@ registries = [
159154
# https://embarkstudios.github.io/cargo-deny/checks/bans/cfg.html
160155
[bans]
161156
# Lint level for when multiple versions of the same crate are detected
162-
multiple-versions = "warn"
157+
multiple-versions = "allow"
163158
# Lint level for when a crate version requirement is `*`
164159
wildcards = "allow"
165160
# The graph highlighting used when creating dotgraphs for crates

src/diff/data.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ pub fn diff_data_lev(left: &mut ObjSection, right: &mut ObjSection) -> Result<()
393393

394394
left.data_diff = left_diff;
395395
right.data_diff = right_diff;
396-
return Ok(());
396+
Ok(())
397397
}
398398

399399
pub fn no_diff_data(section: &mut ObjSection) {

0 commit comments

Comments
 (0)