Skip to content

Commit 47ebee4

Browse files
committed
Add armv7 architecture and refactor build workflow
1 parent 15a9817 commit 47ebee4

File tree

1 file changed

+65
-15
lines changed

1 file changed

+65
-15
lines changed

.github/workflows/build.yml

+65-15
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ jobs:
2424
runs-on: ubuntu-20.04
2525
strategy:
2626
matrix:
27-
arch: [x86, x86_64, aarch64]
28-
cpu_instr: [non-SIMD, SSE2, AVX2, NEON, auto-selected]
27+
arch: [x86, x86_64, armv7, aarch64]
28+
cpu_instr: [non-SIMD, SSE2, auto-selected]
2929

3030
steps:
3131
- uses: actions/checkout@v3
3232
with:
3333
submodules: true
3434
- name: Setup Alpine Linux for x86
35-
if: matrix.arch == 'x86' && matrix.cpu_instr == 'auto-selected'
35+
if: matrix.arch == 'x86'
3636
uses: jirutka/setup-alpine@v1
3737
with:
3838
arch: x86
@@ -42,11 +42,23 @@ jobs:
4242
g++
4343
make
4444
shell-name: alpine-x86.sh
45+
4546
- name: Build trimal for Linux x86
47+
if: matrix.arch == 'x86' && matrix.cpu_instr == 'non-SIMD'
48+
run: cmake . -DDISABLE_SSE2=1 -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
49+
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
50+
shell: alpine-x86.sh {0}
51+
- name: Build trimal for Linux x86 and SSE2
52+
if: matrix.arch == 'x86' && matrix.cpu_instr == 'SSE2'
53+
run: cmake . -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
54+
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
55+
shell: alpine-x86.sh {0}
56+
- name: Build trimal for Linux x86 and auto-selected SIMD (AVX2 if available)
4657
if: matrix.arch == 'x86' && matrix.cpu_instr == 'auto-selected'
4758
run: cmake . && make && file bin/trimal && file bin/readal &&
4859
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
4960
shell: alpine-x86.sh {0}
61+
5062
- name: Build trimal for Linux x86_64
5163
if: matrix.arch == 'x86_64' && matrix.cpu_instr == 'non-SIMD'
5264
run: cmake . -DDISABLE_SSE2=1 -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
@@ -55,17 +67,36 @@ jobs:
5567
if: matrix.arch == 'x86_64' && matrix.cpu_instr == 'SSE2'
5668
run: cmake . -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
5769
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
58-
- name: Build trimal for Linux x86_64 and AVX2
59-
if: matrix.arch == 'x86_64' && matrix.cpu_instr == 'AVX2'
60-
run: cmake . -DDISABLE_SSE2=1 && make && file bin/trimal && file bin/readal &&
61-
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
62-
- name: Build trimal for Linux x86_64 and auto-selected SIMD
70+
- name: Build trimal for Linux x86_64 and auto-selected SIMD (AVX2 if available)
6371
if: matrix.arch == 'x86_64' && matrix.cpu_instr == 'auto-selected'
6472
run: cmake . && make && file bin/trimal && file bin/readal &&
6573
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
6674

67-
- name: Build trimal for Linux aarch64
68-
if: matrix.arch == 'aarch64' && matrix.cpu_instr == 'non-SIMD'
75+
- name: Setup Alpine Linux for armv7
76+
if: matrix.arch == 'armv7'
77+
uses: jirutka/setup-alpine@v1
78+
with:
79+
arch: armv7
80+
packages: >
81+
cmake
82+
file
83+
g++
84+
make
85+
shell-name: alpine-armv7.sh
86+
87+
- name: Build trimal for Linux armv7 (alpine)
88+
if: matrix.arch == 'armv7' && matrix.cpu_instr == 'non-SIMD'
89+
run: cmake . -DDISABLE_SSE2=1 -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
90+
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
91+
shell: alpine-armv7.sh {0}
92+
- name: Build trimal for Linux armv7 (alpine) and auto-selected SIMD (NEON)
93+
if: matrix.arch == 'armv7' && matrix.cpu_instr == 'auto-selected'
94+
run: cmake . && make && file bin/trimal && file bin/readal &&
95+
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
96+
shell: alpine-armv7.sh {0}
97+
98+
- name: Build trimal for Linux armv7 (ubuntu)
99+
if: matrix.arch == 'armv7' && matrix.cpu_instr == 'non-SIMD'
69100
uses: uraimo/run-on-arch-action@v2
70101
# Emulate ARM architecture since it's not natively supported by GitHub.
71102
# Warning about image and host platforms not matching may be ignored (https://github.com/uraimo/run-on-arch-action/issues/127#issuecomment-1605691328)
@@ -79,10 +110,29 @@ jobs:
79110
apt-get update -q -y
80111
apt-get install -q -y cmake make g++ file
81112
run: |
82-
cmake . -DDISABLE_NEON=1 -DDISABLE_SSE2=1 -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
113+
cmake . -DDISABLE_NEON=1 && make && file bin/trimal && file bin/readal &&
83114
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
84-
- name: Build trimal for Linux aarch64 and NEON
85-
if: matrix.arch == 'aarch64' && matrix.cpu_instr == 'NEON'
115+
116+
- name: Build trimal for Linux armv7 (ubuntu) and auto-selected SIMD (NEON)
117+
if: matrix.arch == 'armv7' && matrix.cpu_instr == 'auto-selected'
118+
uses: uraimo/run-on-arch-action@v2
119+
# Emulate ARM architecture since it's not natively supported by GitHub.
120+
# Warning about image and host platforms not matching may be ignored (https://github.com/uraimo/run-on-arch-action/issues/127#issuecomment-1605691328)
121+
with:
122+
arch: ${{ matrix.arch }}
123+
distro: ubuntu20.04
124+
githubToken: ${{ github.token }}
125+
dockerRunArgs: |
126+
--volume "${PWD}:/trimal"
127+
install: |
128+
apt-get update -q -y
129+
apt-get install -q -y cmake make g++ file
130+
run: |
131+
cmake . && make && file bin/trimal && file bin/readal &&
132+
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
133+
134+
- name: Build trimal for Linux aarch64
135+
if: matrix.arch == 'aarch64' && matrix.cpu_instr == 'non-SIMD'
86136
uses: uraimo/run-on-arch-action@v2
87137
# Emulate ARM architecture since it's not natively supported by GitHub.
88138
# Warning about image and host platforms not matching may be ignored (https://github.com/uraimo/run-on-arch-action/issues/127#issuecomment-1605691328)
@@ -96,9 +146,9 @@ jobs:
96146
apt-get update -q -y
97147
apt-get install -q -y cmake make g++ file
98148
run: |
99-
cmake . -DDISABLE_SSE2=1 -DDISABLE_AVX2=1 && make && file bin/trimal && file bin/readal &&
149+
cmake . -DDISABLE_NEON=1 && make && file bin/trimal && file bin/readal &&
100150
./scripts/generate_trimmed_msas.sh && ./scripts/compare_trimmed_msas.sh
101-
- name: Build trimal for Linux aarch64 and auto-selected SIMD
151+
- name: Build trimal for Linux aarch64 and auto-selected SIMD (NEON)
102152
if: matrix.arch == 'aarch64' && matrix.cpu_instr == 'auto-selected'
103153
uses: uraimo/run-on-arch-action@v2
104154
# Emulate ARM architecture since it's not natively supported by GitHub.

0 commit comments

Comments
 (0)