Skip to content

Commit f4851e1

Browse files
committed
merge dev and fix conflicts
2 parents 3a21e71 + a0d8723 commit f4851e1

File tree

228 files changed

+22208
-9517
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+22208
-9517
lines changed

.docker/Dockerfile

+8-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM docker.io/debian:buster-slim
1+
FROM docker.io/debian:10
22

33
MAINTAINER Onur Özkan <[email protected]>
44

@@ -10,6 +10,7 @@ RUN apt-get install -y \
1010
ca-certificates \
1111
curl \
1212
wget \
13+
unzip \
1314
gnupg
1415

1516
RUN ln -s /usr/bin/python3 /bin/python
@@ -26,11 +27,11 @@ RUN ./llvm.sh 16
2627

2728
RUN rm ./llvm.sh
2829

29-
RUN ln -s /usr/bin/clang-16 /usr/bin/clang
30-
3130
ENV AR=/usr/bin/llvm-ar-16
3231
ENV CC=/usr/bin/clang-16
3332

33+
RUN ln -s /usr/bin/clang-16 /usr/bin/clang
34+
3435
RUN mkdir -m 0755 -p /etc/apt/keyrings
3536

3637
RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
@@ -47,6 +48,9 @@ RUN apt-get install -y \
4748
containerd.io \
4849
docker-buildx-plugin
4950

50-
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
51+
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --profile minimal --default-toolchain nightly-2022-10-29 -y
52+
53+
RUN wget https://github.com/protocolbuffers/protobuf/releases/download/v3.20.1/protoc-3.20.1-linux-x86_64.zip
54+
RUN unzip protoc-3.20.1-linux-x86_64.zip && mv ./include/google /usr/include/google
5155

5256
ENV PATH="/root/.cargo/bin:$PATH"
+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Install Dependencies
2+
description: Install non-cargo dependencies in an OS-agnostic way
3+
4+
inputs:
5+
deps:
6+
description: "Dependencies to install (format: ('list' 'of' 'dependencies'))."
7+
required: true
8+
temp:
9+
description: "A temporary directory path that can be used to store the installed binaries if needed."
10+
11+
# NOTE: Don't install binaries in the project directory because the directory might be checked out later.
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- name: Install protoc (Linux)
16+
env:
17+
TMP: ${{ inputs.temp || runner.temp }}
18+
if: runner.os == 'Linux' && contains(inputs.deps, 'protoc')
19+
shell: bash
20+
run: |
21+
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-linux-x86_64.zip
22+
unzip protoc-25.3-linux-x86_64 -d "$TMP/protobuf"
23+
echo "$TMP/protobuf/bin" >> $GITHUB_PATH
24+
25+
- name: Install protoc (MacOS)
26+
env:
27+
TMP: ${{ inputs.temp || runner.temp }}
28+
if: runner.os == 'macOS' && contains(inputs.deps, 'protoc')
29+
shell: bash
30+
run: |
31+
wget https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-osx-x86_64.zip
32+
unzip protoc-25.3-osx-x86_64.zip -d "$TMP/protobuf"
33+
echo "$TMP/protobuf/bin" >> $GITHUB_PATH
34+
35+
- name: Install protoc (Windows)
36+
env:
37+
TMP: ${{ inputs.temp || runner.temp }}
38+
if: runner.os == 'Windows' && contains(inputs.deps, 'protoc')
39+
shell: powershell
40+
run: |
41+
Invoke-WebRequest -Uri https://github.com/protocolbuffers/protobuf/releases/download/v25.3/protoc-25.3-win64.zip -OutFile protoc-25.3-win64.zip
42+
7z x protoc-25.3-win64.zip -o"$TMP\protobuf"
43+
echo "$TMP\protobuf\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
44+
45+
- name: Install libudev (Linux)
46+
if: runner.os == 'Linux' && contains(inputs.deps, 'libudev')
47+
shell: bash
48+
run: |
49+
sudo apt-get update -y
50+
sudo apt-get install -y libudev-dev

.github/workflows/dev-build.yml

+46-4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ jobs:
3333
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
3434
rustup default nightly-2022-10-29
3535
36+
- name: Install build deps
37+
uses: ./.github/actions/deps-install
38+
with:
39+
deps: ('protoc')
40+
3641
- name: Calculate commit hash for PR commit
3742
if: github.event_name == 'pull_request'
3843
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
@@ -94,6 +99,12 @@ jobs:
9499
run: |
95100
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
96101
rustup default nightly-2022-10-29
102+
rustup target add x86_64-apple-darwin
103+
104+
- name: Install build deps
105+
uses: ./.github/actions/deps-install
106+
with:
107+
deps: ('protoc')
97108

98109
- name: Calculate commit hash for PR commit
99110
if: github.event_name == 'pull_request'
@@ -145,6 +156,11 @@ jobs:
145156
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
146157
rustup default nightly-2022-10-29
147158
159+
- name: Install build deps
160+
uses: ./.github/actions/deps-install
161+
with:
162+
deps: ('protoc')
163+
148164
- name: Calculate commit hash for PR commit
149165
if: github.event_name == 'pull_request'
150166
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $Env:GITHUB_ENV
@@ -194,8 +210,14 @@ jobs:
194210
- uses: actions/checkout@v3
195211
- name: Install toolchain
196212
run: |
197-
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
198-
rustup default nightly-2022-10-29
213+
rustup toolchain install nightly-2022-10-29-x86_64-apple-darwin --no-self-update --profile=minimal
214+
rustup default nightly-2022-10-29-x86_64-apple-darwin
215+
rustup target add x86_64-apple-darwin
216+
217+
- name: Install build deps
218+
uses: ./.github/actions/deps-install
219+
with:
220+
deps: ('protoc')
199221

200222
- name: Calculate commit hash for PR commit
201223
if: github.event_name == 'pull_request'
@@ -252,6 +274,11 @@ jobs:
252274
echo "/usr/bin" >> $GITHUB_PATH
253275
echo "/root/.cargo/bin" >> $GITHUB_PATH
254276
277+
- name: Install build deps
278+
uses: ./.github/actions/deps-install
279+
with:
280+
deps: ('protoc')
281+
255282
- name: Install toolchain
256283
run: |
257284
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal
@@ -312,6 +339,11 @@ jobs:
312339
rustup default nightly-2022-10-29
313340
rustup target add aarch64-apple-ios
314341
342+
- name: Install build deps
343+
uses: ./.github/actions/deps-install
344+
with:
345+
deps: ('protoc')
346+
315347
- name: Calculate commit hash for PR commit
316348
if: github.event_name == 'pull_request'
317349
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
@@ -373,6 +405,11 @@ jobs:
373405
rustup default nightly-2022-10-29
374406
rustup target add aarch64-linux-android
375407
408+
- name: Install build deps
409+
uses: ./.github/actions/deps-install
410+
with:
411+
deps: ('protoc')
412+
376413
- name: Setup NDK
377414
run: ./scripts/ci/android-ndk.sh x86 23
378415

@@ -402,7 +439,7 @@ jobs:
402439
run: |
403440
NAME="mm2_$COMMIT_HASH-android-aarch64.zip"
404441
mv target/aarch64-linux-android/release/libmm2lib.a target/aarch64-linux-android/release/libmm2.a
405-
zip $NAME target/aarch64-linux-android/release/libmm2.a -j
442+
zip $NAME target/aarch64-linux-android/release/libmm2.a -j
406443
mkdir $BRANCH_NAME
407444
mv $NAME ./$BRANCH_NAME/
408445
@@ -439,6 +476,11 @@ jobs:
439476
rustup default nightly-2022-10-29
440477
rustup target add armv7-linux-androideabi
441478
479+
- name: Install build deps
480+
uses: ./.github/actions/deps-install
481+
with:
482+
deps: ('protoc')
483+
442484
- name: Setup NDK
443485
run: ./scripts/ci/android-ndk.sh x86 23
444486

@@ -468,7 +510,7 @@ jobs:
468510
run: |
469511
NAME="mm2_$COMMIT_HASH-android-armv7.zip"
470512
mv target/armv7-linux-androideabi/release/libmm2lib.a target/armv7-linux-androideabi/release/libmm2.a
471-
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j
513+
zip $NAME target/armv7-linux-androideabi/release/libmm2.a -j
472514
mkdir $BRANCH_NAME
473515
mv $NAME ./$BRANCH_NAME/
474516

.github/workflows/fmt-and-lint.yml

+16-7
Original file line numberDiff line numberDiff line change
@@ -7,34 +7,38 @@ concurrency:
77

88
jobs:
99
fmt-and-lint:
10+
name: x86 Format and Lint Checks
1011
timeout-minutes: 45
1112
runs-on: ${{ matrix.os }}
1213
strategy:
1314
matrix:
1415
os: [ubuntu-latest, macos-latest, windows-latest]
1516
steps:
1617
- uses: actions/checkout@v3
18+
1719
- name: Install toolchain
1820
run: |
1921
rustup toolchain install nightly-2022-10-29 --no-self-update --profile=minimal --component rustfmt clippy
2022
rustup default nightly-2022-10-29
2123
22-
- name: Install OS dependencies
23-
run: |
24-
sudo apt-get update
25-
sudo apt-get -y install libudev-dev
26-
if: matrix.os == 'ubuntu-latest'
24+
- name: Install build deps
25+
uses: ./.github/actions/deps-install
26+
with:
27+
deps: ('protoc' 'libudev-dev')
2728

2829
- name: Cargo cache
2930
uses: ./.github/actions/cargo-cache
3031

3132
- name: fmt check
33+
# Format checks aren't OS dependant.
34+
if: matrix.os == 'ubuntu-latest'
3235
run: cargo fmt -- --check
3336

34-
- name: x86-64 code lint
37+
- name: clippy lint
3538
run: cargo clippy --all-targets --all-features -- --D warnings
3639

3740
wasm-lint:
41+
name: Wasm Lint Checks
3842
timeout-minutes: 45
3943
runs-on: ubuntu-latest
4044
steps:
@@ -45,8 +49,13 @@ jobs:
4549
rustup default nightly-2022-10-29
4650
rustup target add wasm32-unknown-unknown
4751
52+
- name: Install build deps
53+
uses: ./.github/actions/deps-install
54+
with:
55+
deps: ('protoc')
56+
4857
- name: Cargo cache
4958
uses: ./.github/actions/cargo-cache
5059

51-
- name: wasm code lint
60+
- name: clippy lint
5261
run: cargo clippy --target wasm32-unknown-unknown -- --D warnings

.github/workflows/komodefi-cli.yml

+4-40
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ env:
1010

1111
jobs:
1212
code-check:
13+
name: Code Checks
1314
timeout-minutes: 60
1415
runs-on: ${{ matrix.os }}
1516
strategy:
@@ -18,55 +19,18 @@ jobs:
1819
steps:
1920
- uses: actions/checkout@v3
2021

21-
- name: pre scripts for ci container
22-
run: |
23-
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
24-
echo "/bin" >> $GITHUB_PATH
25-
echo "/usr/bin" >> $GITHUB_PATH
26-
echo "/root/.cargo/bin" >> $GITHUB_PATH
27-
28-
- name: Calculate commit hash for PR commit
29-
if: github.event_name == 'pull_request'
30-
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
31-
32-
- name: Calculate commit hash for merge commit
33-
if: github.event_name != 'pull_request'
34-
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
35-
3622
- name: Cargo cache
3723
uses: ./.github/actions/cargo-cache
3824

3925
- name: Start checking code format and lint
26+
continue-on-error: true
4027
run: |
4128
cargo fmt --manifest-path ./mm2src/komodefi_cli/Cargo.toml --all -- --check
4229
cargo clippy --manifest-path ./mm2src/komodefi_cli/Cargo.toml --all-targets --all-features -- --D warnings
4330
44-
test:
45-
timeout-minutes: 60
46-
runs-on: ${{ matrix.os }}
47-
strategy:
48-
matrix:
49-
os: [ubuntu-latest, macos-latest, windows-latest]
50-
steps:
51-
- uses: actions/checkout@v3
52-
53-
- name: pre scripts for ci container
31+
- name: Start building
5432
run: |
55-
git config --global --add safe.directory /__w/komodo-defi-framework/komodo-defi-framework
56-
echo "/bin" >> $GITHUB_PATH
57-
echo "/usr/bin" >> $GITHUB_PATH
58-
echo "/root/.cargo/bin" >> $GITHUB_PATH
59-
60-
- name: Calculate commit hash for PR commit
61-
if: github.event_name == 'pull_request'
62-
run: echo "COMMIT_HASH=$(git rev-parse --short=7 ${{ github.event.pull_request.head.sha }})" >> $GITHUB_ENV
63-
64-
- name: Calculate commit hash for merge commit
65-
if: github.event_name != 'pull_request'
66-
run: echo "COMMIT_HASH=$(git rev-parse --short=7 HEAD)" >> $GITHUB_ENV
67-
68-
- name: Cargo cache
69-
uses: ./.github/actions/cargo-cache
33+
cargo build --manifest-path ./mm2src/adex_cli/Cargo.toml
7034
7135
- name: Start testing
7236
run: |

.github/workflows/pr-lint.yml

+5-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: "PR Lint"
1+
name: PR Lint
22

33
on:
44
pull_request:
@@ -45,11 +45,9 @@ jobs:
4545
fi
4646
4747
- name: Check PR labels
48-
if: >
49-
(contains(toJson(github.event.pull_request.labels.*.name), 'under review') == false &&
50-
contains(toJson(github.event.pull_request.labels.*.name), 'in progress') == false) ||
51-
(contains(toJson(github.event.pull_request.labels.*.name), 'under review') == true &&
52-
contains(toJson(github.event.pull_request.labels.*.name), 'in progress') == true)
48+
env:
49+
LABEL_NAMES: ${{ toJson(github.event.pull_request.labels.*.name) }}
50+
if: contains(env.LABEL_NAMES, 'under review') == contains(env.LABEL_NAMES, 'in progress')
5351
run: |
54-
echo "PR must have "exactly one" of these labels: [ 'under review', 'in progress' ]."
52+
echo "PR must have "exactly one" of these labels: ['under review', 'in progress']."
5553
exit 1

0 commit comments

Comments
 (0)