Skip to content

Commit 363b49f

Browse files
authored
chore(CI): build a portable binary in CI for different CPU architectures (#1504)
* chore(CI): RocksDB uses `-march=native`, Axon uses it too * chore(CI): build a portable binary in CI for different CPU architectures
1 parent 9a0bdbd commit 363b49f

8 files changed

+54
-9
lines changed

.github/workflows/axon-start-with-short-genesis.yml

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ jobs:
3232
restore-keys: |
3333
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
3434
- name: Build Axon in the development profile
35-
run: cargo build
35+
run: |
36+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
37+
# related issue: https://github.com/axonweb3/axon/issues/1387
38+
lscpu
39+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
40+
PORTABLE=1 USE_SSE=1 cargo build
3641
3742
- name: Start a single Axon node
3843
env:
@@ -87,7 +92,12 @@ jobs:
8792
restore-keys: |
8893
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
8994
- name: Build Axon in the development profile
90-
run: cargo build
95+
run: |
96+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
97+
# related issue: https://github.com/axonweb3/axon/issues/1387
98+
lscpu
99+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
100+
PORTABLE=1 USE_SSE=1 cargo build
91101
92102
- name: Start multiple Axon nodes
93103
env:

.github/workflows/hardfork_test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,12 @@ jobs:
3131
restore-keys: |
3232
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
3333
- name: Build Axon in the development profile
34-
run: cargo build
34+
run: |
35+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
36+
# related issue: https://github.com/axonweb3/axon/issues/1387
37+
lscpu
38+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
39+
PORTABLE=1 USE_SSE=1 cargo build
3540
3641
- name: Start multiple Axon nodes
3742
env:

.github/workflows/openzeppelin_test_11.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ jobs:
105105
restore-keys: |
106106
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
107107
- name: Build Axon in the development profile
108-
run: cargo build
108+
run: |
109+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
110+
# related issue: https://github.com/axonweb3/axon/issues/1387
111+
lscpu
112+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
113+
PORTABLE=1 USE_SSE=1 cargo build
109114
110115
- name: Deploy Local Network of Axon
111116
run: |

.github/workflows/openzeppelin_test_16_19.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ jobs:
105105
restore-keys: |
106106
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
107107
- name: Build Axon in the development profile
108-
run: cargo build
108+
run: |
109+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
110+
# related issue: https://github.com/axonweb3/axon/issues/1387
111+
lscpu
112+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
113+
PORTABLE=1 USE_SSE=1 cargo build
109114
110115
- name: Deploy Local Network of Axon
111116
run: |

.github/workflows/openzeppelin_test_1_5_and_12_15.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,12 @@ jobs:
106106
restore-keys: |
107107
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
108108
- name: Build Axon in the development profile
109-
run: cargo build
109+
run: |
110+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
111+
# related issue: https://github.com/axonweb3/axon/issues/1387
112+
lscpu
113+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
114+
PORTABLE=1 USE_SSE=1 cargo build
110115
111116
- name: Deploy Local Network of Axon
112117
run: |

.github/workflows/openzeppelin_test_6_10.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,12 @@ jobs:
105105
restore-keys: |
106106
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
107107
- name: Build Axon in the development profile
108-
run: cargo build
108+
run: |
109+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
110+
# related issue: https://github.com/axonweb3/axon/issues/1387
111+
lscpu
112+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
113+
PORTABLE=1 USE_SSE=1 cargo build
109114
110115
- name: Deploy Local Network of Axon
111116
run: |

.github/workflows/v3_core_test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,12 @@ jobs:
9393
restore-keys: |
9494
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
9595
- name: Build Axon in the development profile
96-
run: cargo build
96+
run: |
97+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
98+
# related issue: https://github.com/axonweb3/axon/issues/1387
99+
lscpu
100+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
101+
PORTABLE=1 USE_SSE=1 cargo build
97102
98103
- name: Deploy Local Network of Axon
99104
run: |

.github/workflows/web3_compatible.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ jobs:
6565
restore-keys: |
6666
${{ matrix.os }}-${{ runner.os }}-${{ runner.arch }}-cargo-build
6767
- name: Build Axon in the development profile
68-
run: cargo build
68+
run: |
69+
# check for AVX2 support by inspecting `/proc/cpuinfo` or running `lscpu`
70+
# related issue: https://github.com/axonweb3/axon/issues/1387
71+
lscpu
72+
# PORTABLE=1 USE_SSE=1 tell rocksdb to target AVX2
73+
PORTABLE=1 USE_SSE=1 cargo build
6974
- name: Deploy Local Network of Axon
7075
run: |
7176
./target/debug/axon init \

0 commit comments

Comments
 (0)