Skip to content

fix: Resolved build failure when performing non-parallel builds. #531

fix: Resolved build failure when performing non-parallel builds.

fix: Resolved build failure when performing non-parallel builds. #531

Workflow file for this run

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-mpiifort:
timeout-minutes: 60 # Max execution time (min)
runs-on: ubuntu-latest
env:
KEYVERSION: v1 # If you don't want to cache (intel fortran), you should change KEYVERSION.
FC: mpiifort # MPI-Intel-Fortran
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
printenv >> $GITHUB_ENV
- name: Install cmake
run: |
sudo apt-get install -y cmake
- 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 2 --build
- 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: awvwgk/setup-fortran@10d482ae709dc07adfb4ff5d152dc315ec5abbe9 # Fix the commit hash to avoid breaking changes.
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 2 --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
- name: Run unittest(serial, run all tests, push to main branch)
if: ${{ github.ref_name == 'main' && github.event_name == 'push' }}
run: |
pytest --all