Skip to content

Commit 0534325

Browse files
committed
Parallel CI construction to reduce CI time
1 parent 434b849 commit 0534325

File tree

2 files changed

+88
-18
lines changed

2 files changed

+88
-18
lines changed

.github/workflows/CI.yml

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ jobs:
3333
build: cmake-inline
3434
toolchain:
3535
- {compiler: gcc, version: 10}
36-
APT_PACKAGES: >-
37-
intel-oneapi-mkl-2024.1.0
38-
intel-oneapi-mkl-devel-2024.1.0
3936
exclude:
4037
- os: macos-12
4138
toolchain: {compiler: intel, version: '2024.1'}
@@ -62,7 +59,8 @@ jobs:
6259
with:
6360
compiler: ${{ matrix.toolchain.compiler }}
6461
version: ${{ matrix.toolchain.version }}
65-
62+
63+
# Build and test with built-in BLAS and LAPACK
6664
- name: Configure with CMake
6765
if: ${{ contains(matrix.build, 'cmake') }}
6866
run: >-
@@ -94,9 +92,41 @@ jobs:
9492
if: ${{ contains(matrix.build, 'cmake') }}
9593
run: cmake --install ${{ env.BUILD_DIR }}
9694

95+
Build-with-MKL:
96+
runs-on: ubuntu-latest
97+
strategy:
98+
fail-fast: false
99+
matrix:
100+
toolchain:
101+
- {compiler: intel, version: '2024.1'}
102+
include:
103+
- APT_PACKAGES: >-
104+
intel-oneapi-mkl-2024.1.0
105+
intel-oneapi-mkl-devel-2024.1.0
106+
build: [cmake]
107+
env:
108+
BUILD_DIR: ${{ matrix.build == 'cmake' && 'build' || '.' }}
109+
steps:
110+
- name: Checkout code
111+
uses: actions/checkout@v4
112+
113+
- name: Set up Python 3.x
114+
uses: actions/setup-python@v5 # Use pip to install latest CMake, & FORD/Jin2For, etc.
115+
with:
116+
python-version: 3.x
117+
118+
- name: Install fypp
119+
run: pip install --upgrade fypp ninja
120+
121+
- name: Setup Fortran compiler
122+
uses: fortran-lang/[email protected]
123+
id: setup-fortran
124+
with:
125+
compiler: ${{ matrix.toolchain.compiler }}
126+
version: ${{ matrix.toolchain.version }}
127+
97128
# Build and test with external BLAS and LAPACK (MKL on Ubuntu with Intel compilers)
98129
- name: Configure with CMake and MKL
99-
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
100130
run: >-
101131
cmake -Wdev -G Ninja
102132
-DCMAKE_BUILD_TYPE=Release
@@ -107,15 +137,13 @@ jobs:
107137
-S . -B build_mkl
108138
109139
- name: Build and compile with MKL
110-
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
111140
run: cmake --build build_mkl --parallel
112141

113142
- name: catch build fail with MKL
114-
if: ${{ failure() && contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
143+
if: failure()
115144
run: cmake --build build_mkl --verbose --parallel 1
116145

117146
- name: test with MKL
118-
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
119147
run: >-
120148
ctest
121149
--test-dir build_mkl
@@ -124,5 +152,4 @@ jobs:
124152
--no-tests=error
125153
126154
- name: Install project with MKL
127-
if: ${{ contains(matrix.build, 'cmake') && matrix.os == 'ubuntu-latest' && matrix.toolchain.compiler == 'intel' }}
128155
run: cmake --install build_mkl

.github/workflows/ci_windows.yml

Lines changed: 52 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ jobs:
3838
mingw-w64-${{ matrix.arch }}-python-setuptools
3939
mingw-w64-${{ matrix.arch }}-cmake
4040
mingw-w64-${{ matrix.arch }}-ninja
41-
mingw-w64-${{ matrix.arch }}-openblas
4241
4342
- name: Setup msys POSIX environment
4443
uses: msys2/setup-msys2@v2
@@ -57,8 +56,8 @@ jobs:
5756
5857
- name: Install fypp
5958
run: pip install fypp
60-
61-
# Build and test with build-in BLAS and LAPACK
59+
60+
# Build and test with built-in BLAS and LAPACK
6261
- run: >-
6362
PATH=$PATH:/mingw64/bin/ cmake
6463
-Wdev
@@ -92,9 +91,56 @@ jobs:
9291
- name: Install project
9392
run: PATH=$PATH:/mingw64/bin/ cmake --install build
9493

94+
msys2-build-with-OpenBLAS:
95+
runs-on: windows-latest
96+
strategy:
97+
fail-fast: false
98+
matrix:
99+
include: [
100+
{ msystem: MINGW64, arch: x86_64 }
101+
]
102+
defaults:
103+
run:
104+
shell: msys2 {0}
105+
steps:
106+
- uses: actions/checkout@v2
107+
108+
- name: Setup MinGW native environment
109+
uses: msys2/setup-msys2@v2
110+
with:
111+
msystem: ${{ matrix.msystem }}
112+
update: false
113+
install: >-
114+
git
115+
mingw-w64-${{ matrix.arch }}-gcc
116+
mingw-w64-${{ matrix.arch }}-gcc-fortran
117+
mingw-w64-${{ matrix.arch }}-python
118+
mingw-w64-${{ matrix.arch }}-python-pip
119+
mingw-w64-${{ matrix.arch }}-python-setuptools
120+
mingw-w64-${{ matrix.arch }}-cmake
121+
mingw-w64-${{ matrix.arch }}-ninja
122+
mingw-w64-${{ matrix.arch }}-openblas
123+
124+
- name: Setup msys POSIX environment
125+
uses: msys2/setup-msys2@v2
126+
if: contains(matrix.msystem, 'MSYS')
127+
with:
128+
msystem: MSYS
129+
update: false
130+
install: >-
131+
git
132+
mingw-w64-x86_64-gcc
133+
mingw-w64-x86_64-gcc-fortran
134+
python
135+
python-pip
136+
cmake
137+
ninja
138+
139+
- name: Install fypp
140+
run: pip install fypp
141+
95142
# Build and test with external BLAS and LAPACK (OpenBLAS on MINGW64)
96143
- name: Configure with CMake and OpenBLAS
97-
if: contains(matrix.msystem, 'MINGW64')
98144
run: >-
99145
PATH=$PATH:/mingw64/bin/ cmake
100146
-Wdev
@@ -110,23 +156,20 @@ jobs:
110156
CXX: g++
111157

112158
- name: CMake build with OpenBLAS
113-
if: contains(matrix.msystem, 'MINGW64')
114159
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --parallel
115160

116161
- name: catch build fail
117-
if: contains(matrix.msystem, 'MINGW64') && failure()
162+
if: failure()
118163
run: PATH=$PATH:/mingw64/bin/ cmake --build build_openblas --verbose --parallel 1
119164

120165
- name: CTest with OpenBLAS
121-
if: contains(matrix.msystem, 'MINGW64')
122166
run: PATH=$PATH:/mingw64/bin/ ctest --test-dir build_openblas --output-on-failure --parallel -V -LE quadruple_precision
123167

124168
- uses: actions/upload-artifact@v1
125-
if: contains(matrix.msystem, 'MINGW64') && failure()
169+
if: failure()
126170
with:
127171
name: WindowsCMakeTestlog_openblas
128172
path: build_openblas/Testing/Temporary/LastTest.log
129173

130174
- name: Install project with OpenBLAS
131-
if: contains(matrix.msystem, 'MINGW64')
132175
run: PATH=$PATH:/mingw64/bin/ cmake --install build_openblas

0 commit comments

Comments
 (0)