Skip to content

Commit

Permalink
remove ci compilation profile and optimize dev-release profiles
Browse files Browse the repository at this point in the history
Signed-off-by: ozkanonur <work@onurozkan.dev>
  • Loading branch information
onur-ozkan committed Apr 19, 2023
1 parent ef753cd commit 6e64cf5
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 41 deletions.
2 changes: 1 addition & 1 deletion .docker/Dockerfile.dev-release
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM docker.io/debian:stable-slim
WORKDIR /mm2
COPY target/ci/mm2 /usr/local/bin/mm2
COPY target/release/mm2 /usr/local/bin/mm2
EXPOSE 7783
CMD ["mm2"]
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cmake-build-debug
/Dockerfile

!/target/release/mm2
!/target/ci/mm2
!/target/debug/mm2
/mm2src/*/target

/build
Expand Down
52 changes: 26 additions & 26 deletions .github/workflows/dev-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ env:

jobs:
linux-x86-64:
timeout-minutes: 30
timeout-minutes: 60
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
Expand Down Expand Up @@ -45,15 +45,15 @@ jobs:
run: |
rm -f ./MM_VERSION
echo $COMMIT_HASH > ./MM_VERSION
cargo build --bin mm2 --profile ci
cargo build --bin mm2 --release
- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="mm2_$COMMIT_HASH-linux-x86-64.zip"
zip $NAME target/ci/mm2 -j
zip $NAME target/release/mm2 -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/
Expand Down Expand Up @@ -83,7 +83,7 @@ jobs:
docker push komodoofficial/atomicdexapi:dev-latest
mac-x86-64:
timeout-minutes: 30
timeout-minutes: 60
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -104,15 +104,15 @@ jobs:
run: |
rm -f ./MM_VERSION
echo $COMMIT_HASH > ./MM_VERSION
cargo build --bin mm2 --profile ci --target x86_64-apple-darwin
cargo build --bin mm2 --release --target x86_64-apple-darwin
- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="mm2_$COMMIT_HASH-mac-x86-64.zip"
zip $NAME target/x86_64-apple-darwin/ci/mm2 -j
zip $NAME target/x86_64-apple-darwin/release/mm2 -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/
Expand All @@ -130,7 +130,7 @@ jobs:
remote: "/uploads/${{ env.BRANCH_NAME }}"

win-x86-64:
timeout-minutes: 30
timeout-minutes: 60
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -153,7 +153,7 @@ jobs:
remove-item "./MM_VERSION"
}
echo $Env:COMMIT_HASH > ./MM_VERSION
cargo build --bin mm2 --profile ci
cargo build --bin mm2 --release
- name: Compress build output
env:
Expand All @@ -179,7 +179,7 @@ jobs:
remote: "/uploads/${{ env.BRANCH_NAME }}"

mac-dylib-x86-64:
timeout-minutes: 30
timeout-minutes: 60
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -200,16 +200,16 @@ jobs:
run: |
rm -f ./MM_VERSION
echo $COMMIT_HASH > ./MM_VERSION
cargo rustc --target x86_64-apple-darwin --lib --profile ci --package mm2_bin_lib --crate-type=staticlib
cargo rustc --target x86_64-apple-darwin --lib --release --package mm2_bin_lib --crate-type=staticlib
- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="mm2_$COMMIT_HASH-mac-dylib-x86-64.zip"
mv target/x86_64-apple-darwin/ci/libmm2lib.a target/x86_64-apple-darwin/ci/libmm2.a
zip $NAME target/x86_64-apple-darwin/ci/libmm2.a -j
mv target/x86_64-apple-darwin/release/libmm2lib.a target/x86_64-apple-darwin/release/libmm2.a
zip $NAME target/x86_64-apple-darwin/release/libmm2.a -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/
Expand All @@ -227,7 +227,7 @@ jobs:
remote: "/uploads/${{ env.BRANCH_NAME }}"

wasm:
timeout-minutes: 30
timeout-minutes: 60
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
Expand Down Expand Up @@ -261,7 +261,7 @@ jobs:
run: |
rm -f ./MM_VERSION
echo $COMMIT_HASH > ./MM_VERSION
wasm-pack build mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release
wasm-pack build --release mm2src/mm2_bin_lib --target web --out-dir ../../target/target-wasm-release
- name: Compress build output
env:
Expand All @@ -287,7 +287,7 @@ jobs:
remote: "/uploads/${{ env.BRANCH_NAME }}"

ios-aarch64:
timeout-minutes: 30
timeout-minutes: 60
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -309,16 +309,16 @@ jobs:
run: |
rm -f ./MM_VERSION
echo $COMMIT_HASH > ./MM_VERSION
cargo rustc --target aarch64-apple-ios --lib --profile ci --package mm2_bin_lib --crate-type=staticlib
cargo rustc --target aarch64-apple-ios --lib --release --package mm2_bin_lib --crate-type=staticlib
- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="mm2_$COMMIT_HASH-ios-aarch64.zip"
mv target/aarch64-apple-ios/ci/libmm2lib.a target/aarch64-apple-ios/ci/libmm2.a
zip $NAME target/aarch64-apple-ios/ci/libmm2.a -j
mv target/aarch64-apple-ios/release/libmm2lib.a target/aarch64-apple-ios/release/libmm2.a
zip $NAME target/aarch64-apple-ios/release/libmm2.a -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/
Expand All @@ -336,7 +336,7 @@ jobs:
remote: "/uploads/${{ env.BRANCH_NAME }}"

android-aarch64:
timeout-minutes: 30
timeout-minutes: 60
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
Expand Down Expand Up @@ -372,16 +372,16 @@ jobs:
echo $COMMIT_HASH > ./MM_VERSION
export PATH=$PATH:/android-ndk/bin
CC_aarch64_linux_android=aarch64-linux-android21-clang CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang cargo rustc --target=aarch64-linux-android --lib --profile ci --crate-type=staticlib --package mm2_bin_lib
CC_aarch64_linux_android=aarch64-linux-android21-clang CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android21-clang cargo rustc --target=aarch64-linux-android --lib --release --crate-type=staticlib --package mm2_bin_lib
- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="mm2_$COMMIT_HASH-android-aarch64.zip"
mv target/aarch64-linux-android/ci/libmm2lib.a target/aarch64-linux-android/ci/libmm2.a
zip $NAME target/aarch64-linux-android/ci/libmm2.a -j
mv target/aarch64-linux-android/release/libmm2lib.a target/aarch64-linux-android/release/libmm2.a
zip $NAME target/aarch64-linux-android/release/libmm2.a -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/
Expand All @@ -399,7 +399,7 @@ jobs:
remote: "/uploads/${{ env.BRANCH_NAME }}"

android-armv7:
timeout-minutes: 30
timeout-minutes: 60
runs-on: ubuntu-latest
container: komodoofficial/ci-container:latest
steps:
Expand Down Expand Up @@ -435,16 +435,16 @@ jobs:
echo $COMMIT_HASH > ./MM_VERSION
export PATH=$PATH:/android-ndk/bin
CC_armv7_linux_androideabi=armv7a-linux-androideabi21-clang CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang cargo rustc --target=armv7-linux-androideabi --lib --profile ci --crate-type=staticlib --package mm2_bin_lib
CC_armv7_linux_androideabi=armv7a-linux-androideabi21-clang CARGO_TARGET_ARMV7_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi21-clang cargo rustc --target=armv7-linux-androideabi --lib --release --crate-type=staticlib --package mm2_bin_lib
- name: Compress build output
env:
AVAILABLE: ${{ secrets.FILE_SERVER_KEY }}
if: ${{ env.AVAILABLE != '' }}
run: |
NAME="mm2_$COMMIT_HASH-android-armv7.zip"
mv target/armv7-linux-androideabi/ci/libmm2lib.a target/armv7-linux-androideabi/ci/libmm2.a
zip $NAME target/armv7-linux-androideabi/ci/libmm2.a -j
mv target/armv7-linux-androideabi/release/libmm2lib.a target/armv7-linux-androideabi/release/libmm2.a
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j
mkdir $BRANCH_NAME
mv $NAME ./$BRANCH_NAME/
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/fmt-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
run: cargo fmt -- --check

- name: x86-64 code lint
run: cargo clippy --all-targets --profile ci -- --D warnings
run: cargo clippy --all-targets -- --D warnings

wasm-lint:
timeout-minutes: 45
Expand All @@ -37,4 +37,4 @@ jobs:
rustup target add wasm32-unknown-unknown
- name: wasm code lint
run: cargo clippy --target wasm32-unknown-unknown --profile ci -- --D warnings
run: cargo clippy --target wasm32-unknown-unknown -- --D warnings
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
- name: Test
run: |
# wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params-alt.sh | bash
cargo test --bins --lib --profile ci
cargo test --bins --lib
mac-x86-64-unit:
timeout-minutes: 90
Expand All @@ -50,7 +50,7 @@ jobs:
- name: Test
run: |
# wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params-alt.sh | bash
cargo test --bins --lib --target x86_64-apple-darwin --profile ci
cargo test --bins --lib --target x86_64-apple-darwin
win-x86-64-unit:
timeout-minutes: 90
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
# Restart-Service docker
# Get-Service docker
cargo test --bins --lib --profile ci
cargo test --bins --lib
linux-x86-64-mm2-integration:
timeout-minutes: 90
Expand All @@ -105,7 +105,7 @@ jobs:
rustup default nightly-2022-10-29
- name: Test
run: cargo test --test 'mm2_tests_main' --profile ci
run: cargo test --test 'mm2_tests_main'

# https://docs.github.com/en/actions/learn-github-actions/usage-limits-billing-and-administration#usage-limits
# https://github.com/KomodoPlatform/atomicDEX-API/actions/runs/4419618128/jobs/7748266141#step:4:1790
Expand All @@ -127,7 +127,7 @@ jobs:
# rustup target add x86_64-apple-darwin

# - name: Test
# run: cargo test --test 'mm2_tests_main' --target x86_64-apple-darwin --profile ci
# run: cargo test --test 'mm2_tests_main' --target x86_64-apple-darwin

win-x86-64-mm2-integration:
timeout-minutes: 90
Expand All @@ -146,7 +146,7 @@ jobs:
rustup default nightly-2022-10-29
- name: Test
run: cargo test --test 'mm2_tests_main' --profile ci
run: cargo test --test 'mm2_tests_main'

docker-tests:
timeout-minutes: 90
Expand All @@ -167,7 +167,7 @@ jobs:
- name: Test
run: |
wget -O - https://raw.githubusercontent.com/KomodoPlatform/komodo/master/zcutil/fetch-params-alt.sh | bash
cargo test --test 'docker_tests_main' --features run-docker-tests --profile ci
cargo test --test 'docker_tests_main' --features run-docker-tests
wasm:
timeout-minutes: 90
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

**Enhancements/Fixes:**
- An issue was fixed where we don't have to wait for all EVM nodes to sync the latest account nonce [#1757](https://github.com/KomodoPlatform/atomicDEX-API/pull/1757)
- optimized dev and release compilation profiles and removed ci [#1759](https://github.com/KomodoPlatform/atomicDEX-API/pull/1759)

## v1.0.2-beta - 2023-04-11

Expand Down
13 changes: 9 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ debug-assertions = false
# For some reason, opt-level 3 started causing infinite Windows builds after Cosmos integration
# TODO troubleshoot it
opt-level = 2
codegen-units = 1
lto = true
panic = "abort"

[profile.test]
# required to avoid a long running process of librustcash additional chain validation that is enabled with debug assertions
Expand All @@ -63,8 +66,10 @@ debug-assertions = false
# Turns debugging symbols off for the out-of-workspace dependencies.
debug = false

[profile.ci]
inherits = "dev"
# full debug info is not required
[profile.dev]
opt-level = 0
debug = 1
debug-assertions = false
debug-assertions = false
panic = 'unwind'
incremental = true
codegen-units = 256

0 comments on commit 6e64cf5

Please sign in to comment.