-
Notifications
You must be signed in to change notification settings - Fork 0
168 lines (164 loc) · 5.99 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: DIRAC-CASPT2-CI-test
on:
push:
paths:
# Ref : https://mzqvis6akmakplpmcjx3.hatenablog.com/entry/2021/02/07/134133
# Run CI when only source code, build configuration, test files or files related to CI are modified.
- "**.f90"
- "**.F90"
- "**.cmake"
- "**/CMakeLists.txt"
- "**.py"
- "tools/**"
- ".github/workflows/**"
pull_request:
branches:
- "main"
paths:
# Ref : https://mzqvis6akmakplpmcjx3.hatenablog.com/entry/2021/02/07/134133
# Run CI when only source code, build configuration, test files or files related to CI are modified.
- "**.f90"
- "**.F90"
- "**.cmake"
- "**/CMakeLists.txt"
- "**.py"
- "tools/**"
- ".github/workflows/**"
# Ref : https://github.com/pytest-dev/pytest/issues/7443#issue-650484842
env:
PYTEST_ADDOPTS: "--color=yes"
defaults:
run:
shell: bash
jobs:
test-linux-intel-mpi:
timeout-minutes: 60 # Max execution time (min)
runs-on: ubuntu-latest
strategy:
matrix:
fc: [mpiifort, mpiifx]
env:
KEYVERSION: v1 # If you don't want to cache (intel fortran), you should change KEYVERSION.
steps:
- uses: actions/checkout@v3
- name: cache install
id: cache-install
uses: actions/cache@v3
with:
path: |
/opt/intel/oneapi
key: ${{ runner.os }}-install-${{ env.KEYVERSION }}
- name: Update packages
run: |
sudo apt-get update
- name: Setup Intel fortran (apt)
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install Intel Fortran compiler
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y intel-oneapi-compiler-fortran intel-oneapi-openmp intel-oneapi-mpi intel-oneapi-mpi-devel intel-oneapi-mkl
- name: Set Intel oneAPI environments
run: |
source /opt/intel/oneapi/setvars.sh --force
printenv >> $GITHUB_ENV
- name: Install cmake
run: |
sudo apt-get install -y cmake
- run: ${{ matrix.fc }} --version
- name: Install python
uses: actions/setup-python@v4
with:
python-version: "3.9"
architecture: "x64"
- name: Install pytest for unit test
run: python -m pip install pytest
- name: Build source code (parallel)
run: |
./setup --mpi --omp -j --build --fc ${{ matrix.fc }}
- name: Run unittest(parallel, run slowonly tests, pull_request)
if: ${{ github.event_name == 'pull_request' }}
run: |
pytest --slowonly --mpi=2
- name: Run unittest(parallel, run normal and slow tests, push to other than main branch)
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }}
run: |
pytest --mpi=2
- name: Run unittest(parallel, run all tests, push to main branch)
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
run: |
pytest --all --mpi=2
test-linux-gfortran:
timeout-minutes: 60 # Max execution time (min)
runs-on: ubuntu-20.04 # gfortran-7 is not supported on ubuntu-latest
strategy:
matrix:
compiler: [gcc]
version: [7, 8, 9, 10, 11] # If you want to build multiple version, you can add version number at this line.
env:
KEYVERSION: v1 # If you don't want to cache (intel fortran), you should change KEYVERSION.
FC: gfortran
steps:
- uses: actions/checkout@v3
- name: cache install (MKL)
id: cache-install
uses: actions/cache@v3
with:
path: |
/opt/intel/oneapi
key: ${{ runner.os }}-install-${{ matrix.version }}-${{ env.KEYVERSION }}
- name: Update packages
run: |
sudo apt-get update
- name: Setup MKL
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB
echo "deb https://apt.repos.intel.com/oneapi all main" | sudo tee /etc/apt/sources.list.d/oneAPI.list
sudo apt-get update
- name: Install MKL
if: steps.cache-install.outputs.cache-hit != 'true'
run: |
sudo apt-get install -y intel-oneapi-mkl
- name: Install cmake
run: |
sudo apt-get install -y cmake
- name: Set Intel oneAPI environments
run: |
source /opt/intel/oneapi/setvars.sh
printenv >> $GITHUB_ENV
- uses: fortran-lang/[email protected]
id: setup-fortran
with:
compiler: ${{ matrix.compiler }}
version: ${{ matrix.version }}
- run: ${{ env.FC }} --version
env:
FC: ${{ steps.setup-fortran.outputs.fc }}
- name: Install python
uses: actions/setup-python@v4
with:
python-version: "3.9"
architecture: "x64"
- name: Install pytest for unit test
run: python -m pip install pytest
- name: Build source code
run: |
./setup --fc ${{ env.FC }} --omp -j --build
- name: Run unittest(serial, run slowonly tests, pull_request)
if: ${{ github.event_name == 'pull_request' }}
run: |
pytest --slowonly
- name: Run unittest(serial, run normal and slow tests, push to other than main branch)
if: ${{ github.ref_name != 'main' && github.event_name == 'push' }}
run: |
pytest --omp=2
- name: Run unittest(serial, run all tests, push to main branch)
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
run: |
pytest --all