Skip to content

Commit 516d8d9

Browse files
authored
Merge pull request #407 from IntegerLimit/master
Improve CI Script
2 parents 977cc43 + c65e585 commit 516d8d9

File tree

1 file changed

+88
-29
lines changed

1 file changed

+88
-29
lines changed

.github/workflows/ci.yaml

Lines changed: 88 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,11 @@ jobs:
2323
# Oldest supported gcc and cmake versions
2424
- gcc-version: 9
2525
cmake-version: 3.14.7
26+
upload: false
2627
# Latest supported gcc and cmake versions
2728
- gcc-version: 12
2829
cmake-version: latest
30+
upload: true
2931

3032
steps:
3133
- name: Checkout
@@ -47,38 +49,48 @@ jobs:
4749
run: |
4850
mkdir build
4951
cd build
50-
cmake .. -DCMAKE_C_COMPILER=$(which gcc-${{ matrix.gcc-version }}) -DCMAKE_CXX_COMPILER=$(which g++-${{ matrix.gcc-version }})
52+
cmake .. -DIQTREE_FLAGS=static -DCMAKE_C_COMPILER=$(which gcc-${{ matrix.gcc-version }}) -DCMAKE_CXX_COMPILER=$(which g++-${{ matrix.gcc-version }})
5153
make -j
5254
file iqtree2 | grep x86-64
5355
54-
# build-linux-aarch64:
55-
# name: Linux aarch64
56-
# runs-on: ubuntu-latest
57-
#
58-
# steps:
59-
# - name: Checkout
60-
# uses: actions/checkout@v4
61-
# with:
62-
# submodules: "recursive"
63-
#
64-
# - name: Build on Linux ARM64
65-
# uses: uraimo/run-on-arch-action@v2
66-
# with:
67-
# arch: aarch64
68-
# distro: ubuntu_latest
69-
# githubToken: ${{ github.token }}
70-
# dockerRunArgs: |
71-
# --volume "${PWD}:/iqtree2"
72-
# install: |
73-
# apt-get update -q -y
74-
# apt-get install -q -y cmake gcc g++ file libeigen3-dev libboost-dev
75-
# run: |
76-
# cd /iqtree2
77-
# mkdir build
78-
# cd build
79-
# cmake ..
80-
# make -j
81-
# file iqtree2 | grep aarch64
56+
- name: Upload Built Binary
57+
# Only upload for one of the gcc & cmake tests
58+
if: ${{ matrix.upload }}
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: Linux x86-64
62+
path: build/iqtree2
63+
if-no-files-found: error
64+
65+
build-linux-aarch64:
66+
name: Linux aarch64
67+
runs-on: ubuntu-22.04-arm
68+
69+
steps:
70+
- name: Checkout
71+
uses: actions/checkout@v4
72+
with:
73+
submodules: "recursive"
74+
75+
- name: Install dependencies
76+
run: |
77+
sudo apt-get update -q -y
78+
sudo apt-get install -q -y gcc g++ libeigen3-dev libboost-dev
79+
80+
- name: Build
81+
run: |
82+
mkdir build
83+
cd build
84+
cmake .. -DIQTREE_FLAGS=static
85+
make -j
86+
file iqtree2 | grep aarch64
87+
88+
- name: Upload Built Binary
89+
uses: actions/upload-artifact@v4
90+
with:
91+
name: Linux AArch64
92+
path: build/iqtree2
93+
if-no-files-found: error
8294

8395
build-macos-x86_64:
8496
name: Mac OS x86-64
@@ -104,6 +116,13 @@ jobs:
104116
cmake .. -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
105117
gmake -j
106118
file iqtree2 | grep x86_64
119+
120+
- name: Upload Built Binary
121+
uses: actions/upload-artifact@v4
122+
with:
123+
name: Mac x86-64
124+
path: build/iqtree2
125+
if-no-files-found: error
107126

108127
build-macos-arm:
109128
name: Mac OS ARM64
@@ -130,6 +149,39 @@ jobs:
130149
gmake -j
131150
file iqtree2 | grep arm64
132151
152+
- name: Upload Built Binary
153+
uses: actions/upload-artifact@v4
154+
with:
155+
name: Mac Arm
156+
path: build/iqtree2
157+
if-no-files-found: error
158+
159+
compile-mac-universal:
160+
name: Mac OS Universal
161+
runs-on: macos-14
162+
needs:
163+
- build-macos-x86_64
164+
- build-macos-arm
165+
166+
steps:
167+
- name: Download Artifacts
168+
uses: actions/download-artifact@v4
169+
with:
170+
pattern: Mac *
171+
172+
- name: Combine Artifacts
173+
run: lipo -create -output iqtree2 "Mac x86-64/iqtree2" "Mac Arm/iqtree2"
174+
175+
- name: Check Architectures
176+
run: lipo -archs iqtree2
177+
178+
- name: Upload Built Binary
179+
uses: actions/upload-artifact@v4
180+
with:
181+
name: Mac Universal
182+
path: iqtree2
183+
if-no-files-found: error
184+
133185
build-windows-x86-64:
134186
name: Windows x86-64
135187
runs-on: windows-2022
@@ -179,3 +231,10 @@ jobs:
179231
run: |
180232
cd build
181233
file iqtree2.exe | grep x86-64
234+
235+
- name: Upload Built Binary
236+
uses: actions/upload-artifact@v4
237+
with:
238+
name: Windows x86-64
239+
path: build/iqtree2.exe
240+
if-no-files-found: error

0 commit comments

Comments
 (0)