Skip to content

Commit 95eaccb

Browse files
authored
Merge pull request #119 from gxyd/ci_consolidate
CI: consolidate the CI jobs
2 parents 31033d3 + 340f75a commit 95eaccb

File tree

1 file changed

+45
-220
lines changed

1 file changed

+45
-220
lines changed

.github/workflows/CI.yml

Lines changed: 45 additions & 220 deletions
Original file line numberDiff line numberDiff line change
@@ -12,248 +12,73 @@ env:
1212
MACOSX_DEPLOYMENT_TARGET: 14.0
1313

1414
jobs:
15-
Run_standalone_tests_without_custom_MPI_wrappers_with_OpenMPI:
16-
name: "Run standalone tests with Open MPI without custom MPI Wrappers"
15+
Run_Tests:
16+
name: "Run tests with ${{ matrix.compiler }} and ${{ matrix.mpi }} on ${{ matrix.os }}"
1717
runs-on: ${{ matrix.os }}
1818
strategy:
1919
matrix:
2020
os: ["macos-latest", "ubuntu-latest"]
21+
compiler: ["gfortran", "lfortran"]
22+
mpi: ["openmpi", "mpich"]
2123
steps:
2224
- uses: actions/checkout@v4
2325

2426
- name: Setup Micromamba
2527
uses: mamba-org/[email protected]
2628
with:
2729
micromamba-version: '2.0.4-0'
28-
environment-file: ci/environment_gfortran_openmpi.yml
30+
environment-file: ci/environment_${{ matrix.compiler }}_${{ matrix.mpi }}.yml
2931

30-
- name: Run standalone tests with OpenMPI and without MPI wrappers
32+
- name: Run standalone tests without custom MPI wrappers
33+
if: matrix.compiler == 'gfortran'
3134
shell: bash -e -x -l {0}
3235
run: |
3336
cd tests
3437
./run_tests.sh --without-wrappers
3538
36-
Run_standalone_tests_without_custom_MPI_wrappers_with_MPICH:
37-
name: "Run standalone tests with MPICH without custom MPI Wrappers"
38-
runs-on: ${{ matrix.os }}
39-
strategy:
40-
matrix:
41-
os: ["macos-latest", "ubuntu-latest"]
42-
steps:
43-
- uses: actions/checkout@v4
44-
45-
- name: Setup Micromamba
46-
uses: mamba-org/[email protected]
47-
with:
48-
micromamba-version: '2.0.4-0'
49-
environment-file: ci/environment_gfortran_mpich.yml
50-
51-
- name: Run standalone tests with MPICH and without MPI wrappers
52-
shell: bash -e -x -l {0}
53-
run: |
54-
cd tests
55-
./run_tests.sh --without-wrappers
56-
57-
Run_standalone_tests_with_GFortran_with_OpenMPI:
58-
name: "Run standalone tests with GFortran with Open MPI"
59-
runs-on: ${{ matrix.os }}
60-
strategy:
61-
matrix:
62-
os: ["macos-latest", "ubuntu-latest"]
63-
steps:
64-
- uses: actions/checkout@v4
65-
66-
- name: Setup Micromamba
67-
uses: mamba-org/[email protected]
68-
with:
69-
micromamba-version: '2.0.4-0'
70-
environment-file: ci/environment_gfortran_openmpi.yml
71-
72-
- name: Run standalone tests with GFortran with and without optimization using Open MPI
73-
shell: bash -e -x -l {0}
74-
run: |
75-
cd tests
76-
FC="gfortran -cpp -DOPEN_MPI=yes" ./run_tests.sh
77-
FC="gfortran -O3 -march=native -cpp -DOPEN_MPI=yes" ./run_tests.sh
78-
79-
Run_standalone_tests_with_GFortran_with_MPICH:
80-
name: "Run standalone tests with GFortran with MPICH"
81-
runs-on: ${{ matrix.os }}
82-
strategy:
83-
matrix:
84-
os: ["macos-latest", "ubuntu-latest"]
85-
steps:
86-
- uses: actions/checkout@v4
87-
88-
- name: Setup Micromamba
89-
uses: mamba-org/[email protected]
90-
with:
91-
micromamba-version: '2.0.4-0'
92-
environment-file: ci/environment_gfortran_mpich.yml
93-
94-
- name: Run standalone tests with GFortran with and without optimization using MPICH
95-
shell: bash -e -x -l {0}
96-
run: |
97-
cd tests
98-
FC="gfortran -cpp" ./run_tests.sh
99-
FC="gfortran -O3 -march=native -cpp" ./run_tests.sh
100-
101-
Run_standalone_tests_with_LFortran_with_OpenMPI:
102-
name: "Run standalone tests with LFortran with Open MPI"
103-
runs-on: ${{ matrix.os }}
104-
strategy:
105-
matrix:
106-
os: ["macos-latest", "ubuntu-latest"]
107-
steps:
108-
- uses: actions/checkout@v4
109-
110-
- name: Setup Micromamba
111-
uses: mamba-org/[email protected]
112-
with:
113-
micromamba-version: '2.0.4-0'
114-
environment-file: ci/environment_lfortran_openmpi.yml
115-
116-
- name: Run standalone tests with LFortran with and without optimization using Open MPI
117-
shell: bash -e -x -l {0}
118-
run: |
119-
cd tests
120-
FC="lfortran --cpp -DOPEN_MPI=yes" ./run_tests.sh
121-
FC="lfortran --fast --cpp -DOPEN_MPI=yes" ./run_tests.sh
122-
123-
Run_standalone_tests_with_LFortran_with_MPICH:
124-
name: "Run standalone tests with LFortran with MPICH"
125-
runs-on: ${{ matrix.os }}
126-
strategy:
127-
matrix:
128-
os: ["macos-latest", "ubuntu-latest"]
129-
steps:
130-
- uses: actions/checkout@v4
131-
132-
- name: Setup Micromamba
133-
uses: mamba-org/[email protected]
134-
with:
135-
micromamba-version: '2.0.4-0'
136-
environment-file: ci/environment_lfortran_mpich.yml
137-
138-
- name: Run standalone tests with LFortran with and without optimization using MPICH
39+
- name: Run standalone tests with ${{ matrix.compiler }}
13940
shell: bash -e -x -l {0}
14041
run: |
14142
cd tests
142-
FC="lfortran --cpp" ./run_tests.sh
143-
FC="lfortran --fast --cpp" ./run_tests.sh
144-
145-
Compile_POT3D_with_GFortran_with_OpenMPI:
146-
name: "Build POT3D and validate with GFortran with Open MPI"
147-
runs-on: ${{ matrix.os }}
148-
strategy:
149-
matrix:
150-
os: ["macos-latest", "ubuntu-latest"]
151-
steps:
152-
- uses: actions/checkout@v4
153-
154-
- name: Set up Micromamba
155-
uses: mamba-org/[email protected]
156-
with:
157-
micromamba-version: '2.0.4-0'
158-
environment-file: ci/environment_gfortran_openmpi.yml
159-
160-
# build and validation with GFortran's optimization
161-
- name: POT3D Build and validation with GFortran with optimization using Open MPI (MPI only)
162-
shell: bash -e -x -l {0}
163-
run: |
164-
cd tests/pot3d
165-
FC="gfortran -O3 -march=native -cpp -DOPEN_MPI=yes" ./build_and_run_gfortran.sh
166-
167-
# build and validation without GFortran's optimization
168-
- name: POT3D Build and validation with GFortran without optimization using Open MPI (MPI only)
169-
shell: bash -e -x -l {0}
170-
run: |
171-
cd tests/pot3d
172-
FC="gfortran -cpp -DOPEN_MPI=yes" ./build_and_run_gfortran.sh
173-
174-
Compile_POT3D_with_LFortran_with_OpenMPI:
175-
name: "Build POT3D and validate with LFortran with Open MPI"
176-
runs-on: ${{ matrix.os }}
177-
strategy:
178-
matrix:
179-
os: ["macos-latest", "ubuntu-latest"]
180-
steps:
181-
- uses: actions/checkout@v4
182-
183-
- name: Set up Micromamba
184-
uses: mamba-org/[email protected]
185-
with:
186-
micromamba-version: '2.0.4-0'
187-
environment-file: ci/environment_lfortran_openmpi.yml
188-
189-
# build and validation with LFortran's optimization
190-
- name: POT3D Build and validation with LFortran with optimization using Open MPI (MPI only)
191-
shell: bash -e -x -l {0}
192-
run: |
193-
cd tests/pot3d
194-
FC="lfortran --fast --cpp -DOPEN_MPI=yes" ./build_and_run_lfortran.sh
19543
196-
# build and validation without LFortran's optimization
197-
- name: POT3D Build and validation with LFortran without optimization using Open MPI (MPI only)
44+
if [ "${{ matrix.compiler }}" = "gfortran" ]; then
45+
FC_without_opt="gfortran -cpp"
46+
FC_with_opt="gfortran -O3 -march=native -cpp"
47+
else
48+
FC_without_opt="lfortran --cpp"
49+
FC_with_opt="lfortran --fast --cpp"
50+
fi
51+
52+
# when it's OpenMPI we add "-DOPEN_MPI=yes" flag
53+
if [ "${{ matrix.mpi }}" = "openmpi" ]; then
54+
FC_without_opt="$FC_without_opt -DOPEN_MPI=yes"
55+
FC_with_opt="$FC_with_opt -DOPEN_MPI=yes"
56+
fi
57+
58+
# Run tests with and without optimization
59+
FC="$FC_without_opt" ./run_tests.sh
60+
FC="$FC_with_opt" ./run_tests.sh
61+
62+
- name: Build and validate POT3D with ${{ matrix.compiler }}
19863
shell: bash -e -x -l {0}
19964
run: |
20065
cd tests/pot3d
201-
FC="lfortran --cpp -DOPEN_MPI=yes" ./build_and_run_lfortran.sh
20266
203-
Compile_POT3D_with_GFortran_with_MPICH:
204-
name: "Build POT3D and validate with GFortran with MPICH"
205-
runs-on: ${{ matrix.os }}
206-
strategy:
207-
matrix:
208-
os: ["macos-latest", "ubuntu-latest"]
209-
steps:
210-
- uses: actions/checkout@v4
211-
212-
- name: Set up Micromamba
213-
uses: mamba-org/[email protected]
214-
with:
215-
micromamba-version: '2.0.4-0'
216-
environment-file: ci/environment_gfortran_mpich.yml
217-
218-
# build and validation with GFortran's optimization
219-
- name: POT3D Build and validation with GFortran with optimization (MPI only)
220-
shell: bash -e -x -l {0}
221-
run: |
222-
cd tests/pot3d
223-
FC="gfortran -O3 -march=native -cpp" ./build_and_run_gfortran.sh
224-
225-
# build and validation without GFortran's optimization
226-
- name: POT3D Build and validation with GFortran without optimization (MPI only)
227-
shell: bash -e -x -l {0}
228-
run: |
229-
cd tests/pot3d
230-
FC="gfortran -cpp" ./build_and_run_gfortran.sh
231-
232-
Compile_POT3D_with_LFortran_with_MPICH:
233-
name: "Build POT3D and validate with LFortran with MPICH"
234-
runs-on: ${{ matrix.os }}
235-
strategy:
236-
matrix:
237-
os: ["macos-latest", "ubuntu-latest"]
238-
steps:
239-
- uses: actions/checkout@v4
240-
241-
- name: Set up Micromamba
242-
uses: mamba-org/[email protected]
243-
with:
244-
micromamba-version: '2.0.4-0'
245-
environment-file: ci/environment_lfortran_mpich.yml
246-
247-
# build and validation with LFortran's optimization
248-
- name: POT3D Build and validation with LFortran with optimization using MPICH (MPI only)
249-
shell: bash -e -x -l {0}
250-
run: |
251-
cd tests/pot3d
252-
FC="lfortran --fast --cpp" ./build_and_run_lfortran.sh
253-
254-
# build and validation without LFortran's optimization
255-
- name: POT3D Build and validation with LFortran without optimization using MPICH (MPI only)
256-
shell: bash -e -x -l {0}
257-
run: |
258-
cd tests/pot3d
259-
FC="lfortran --cpp" ./build_and_run_lfortran.sh
67+
if [ "${{ matrix.compiler }}" = "gfortran" ]; then
68+
FC_without_opt="gfortran -cpp"
69+
FC_with_opt="gfortran -O3 -march=native -cpp"
70+
build_script="./build_and_run_gfortran.sh"
71+
else
72+
FC_without_opt="lfortran --cpp"
73+
FC_with_opt="lfortran --fast --cpp"
74+
build_script="./build_and_run_lfortran.sh"
75+
fi
76+
77+
# when it's OpenMPI we add "-DOPEN_MPI=yes" flag
78+
if [ "${{ matrix.mpi }}" = "openmpi" ]; then
79+
FC_without_opt="$FC_without_opt -DOPEN_MPI=yes"
80+
FC_with_opt="$FC_with_opt -DOPEN_MPI=yes"
81+
fi
82+
83+
FC="$FC_without_opt" $build_script
84+
FC="$FC_with_opt" $build_script

0 commit comments

Comments
 (0)