2626 uses : ncipollo/release-action@v1
2727
2828 manylinux :
29- runs-on : ubuntu-latest
29+ strategy :
30+ matrix :
31+ arch :
32+ - x86_64
33+ # - aarch64
34+ runs-on : ${{ matrix.arch == 'aarch64' && 'ubuntu-arm-latest' || 'ubuntu-latest' }}
3035 name : Codon CI (manylinux)
3136 needs : create_release
3237 permissions :
@@ -39,10 +44,15 @@ jobs:
3944 uses : actions/cache@v4
4045 with :
4146 path : llvm
42- key : manylinux-llvm
47+ key : manylinux-${{ matrix.arch }}-llvm
48+
49+ - name : Main x86_64
50+ if : matrix.arch == 'x86_64'
51+ uses : ./.github/actions/build-manylinux-x86_64
4352
44- - name : Main
45- uses : ./.github/actions/build-manylinux
53+ - name : Main aarch64
54+ if : matrix.arch == 'aarch64'
55+ uses : ./.github/actions/build-manylinux-aarch64
4656
4757 - name : Upload Release Asset
4858 if : contains(github.ref, 'tags/v')
6676 matrix :
6777 os :
6878 - ubuntu-latest
69- - macos-12
79+ - macos-latest
80+ # - ubuntu-arm-latest
7081 runs-on : ${{ matrix.os }}
7182 name : Codon CI
7283 needs : create_release
@@ -79,23 +90,49 @@ jobs:
7990 with :
8091 python-version : ' 3.9'
8192
82- - name : Linux Setup
83- if : startsWith(matrix.os, 'ubuntu')
93+ - name : x86_64 Linux Setup
94+ if : startsWith(matrix.os, 'ubuntu') && matrix.os != 'ubuntu-arm-latest'
8495 run : |
96+ sudo apt update
97+ sudo apt install -y gfortran libgfortran5 lsb-release wget software-properties-common gnupg
98+ wget https://apt.llvm.org/llvm.sh
99+ sudo chmod +x llvm.sh
100+ sudo ./llvm.sh 17
85101 echo "LIBEXT=so" >> $GITHUB_ENV
86102 echo "OS_NAME=linux" >> $GITHUB_ENV
103+ echo "CODON_SYSTEM_LIBRARIES=/usr/lib/x86_64-linux-gnu" >> $GITHUB_ENV
104+ echo "CC=clang-17" >> $GITHUB_ENV
105+ echo "CXX=clang++-17" >> $GITHUB_ENV
106+
107+ - name : Arm Linux Setup
108+ if : matrix.os == 'ubuntu-arm-latest'
109+ run : |
110+ sudo apt update
111+ sudo apt install -y gfortran libgfortran5 lsb-release wget software-properties-common gnupg
112+ wget https://apt.llvm.org/llvm.sh
113+ sudo chmod +x llvm.sh
114+ sudo ./llvm.sh 17
115+ echo "LIBEXT=so" >> $GITHUB_ENV
116+ echo "OS_NAME=linux" >> $GITHUB_ENV
117+ echo "CODON_SYSTEM_LIBRARIES=/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
118+ echo "CC=clang-17" >> $GITHUB_ENV
119+ echo "CXX=clang++-17" >> $GITHUB_ENV
87120
88121 - name : macOS Setup
89122 if : startsWith(matrix.os, 'macos')
90123 run : |
91- brew install automake
92124 echo "LIBEXT=dylib" >> $GITHUB_ENV
93125 echo "OS_NAME=osx" >> $GITHUB_ENV
126+ echo "CODON_SYSTEM_LIBRARIES=$(brew --prefix gcc)/lib/gcc/current" >> $GITHUB_ENV
127+ echo "CC=clang" >> $GITHUB_ENV
128+ echo "CXX=clang++" >> $GITHUB_ENV
129+ echo "FC=gfortran-12" >> $GITHUB_ENV
94130
95131 - name : Set up Python
96132 run : |
97133 python -m pip install --upgrade pip setuptools wheel
98- python -m pip install numpy cython wheel astunparse
134+ python -m pip install cython wheel astunparse
135+ python -m pip install --force-reinstall -v "numpy==1.26.4"
99136 which python
100137 which pip
101138 echo "CODON_PYTHON=$(python test/python/find-python-library.py)" >> $GITHUB_ENV
@@ -105,14 +142,11 @@ jobs:
105142 uses : actions/cache@v4
106143 with :
107144 path : llvm
108- key : ${{ runner.os }}-llvm
145+ key : ${{ runner.os }}-${{ matrix.os }}- llvm
109146
110147 - name : Build Dependencies
111148 if : steps.cache-deps.outputs.cache-hit != 'true'
112149 run : ./scripts/deps.sh 2
113- env :
114- CC : clang
115- CXX : clang++
116150
117151 - name : Build
118152 run : |
@@ -123,18 +157,12 @@ jobs:
123157 -DCMAKE_CXX_COMPILER=${CXX})
124158 cmake --build build --config Release -- VERBOSE=1
125159 cmake --install build --prefix=codon-deploy
126- env :
127- CC : clang
128- CXX : clang++
129160
130161 - name : Build Cython
131162 run : |
132163 (cd codon-deploy/python && python3 setup.py sdist)
133164 CODON_DIR=$(pwd)/codon-deploy python -m pip install -v codon-deploy/python/dist/*.gz
134- python test/python/cython_jit.py
135- env :
136- CC : clang
137- CXX : clang++
165+ CODON_PATH=$(pwd)/codon-deploy/lib/codon/stdlib python test/python/cython_jit.py
138166
139167 - name : Test
140168 run : |
@@ -151,6 +179,11 @@ jobs:
151179 run : |
152180 echo "CODON_BUILD_ARCHIVE=codon-$(uname -s | awk '{print tolower($0)}')-$(uname -m).tar.gz" >> $GITHUB_ENV
153181
182+ - name : Codesign (macOS)
183+ if : startsWith(matrix.os, 'macos')
184+ run : |
185+ codesign -f -s - codon-deploy/bin/codon codon-deploy/lib/codon/*.dylib
186+
154187 - name : Prepare Artifacts
155188 run : |
156189 cp -rf codon-deploy/python/dist .
0 commit comments