99 workflow_dispatch :
1010
1111env :
12+ BUILD_PROFILE : release-lto
1213 CARGO_BIN_NAME : objdiff
1314 CARGO_TARGET_DIR : target
1415
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
5269
5370 test :
5471 name : Test
72+ if : ' false' # No tests yet
5573 strategy :
5674 matrix :
5775 platform : [ ubuntu-latest, windows-latest, macos-latest ]
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
0 commit comments