Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cmake #454

Closed
wants to merge 15 commits into from
Closed

Cmake #454

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
workflow_dispatch:
pull_request:
branches: [ develop ]
push:
branches: [ develop ]

permissions:
contents: read

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
tests:
uses: ./.github/workflows/step_test.yaml
68 changes: 0 additions & 68 deletions .github/workflows/main.yml

This file was deleted.

41 changes: 0 additions & 41 deletions .github/workflows/run_tests.sh

This file was deleted.

100 changes: 100 additions & 0 deletions .github/workflows/step_test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: test
run-name: Run tests

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

on:
workflow_call:

permissions:
contents: read

jobs:
pre-commit:
name: Check pre-commit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]

tests:
name: Check on ${{ matrix.toolchain }} toolchain ${{ matrix.mpi }}
runs-on: ${{ matrix.os || 'ubuntu-latest' }}
container: ${{ !matrix.os && 'ghcr.io/lecrisut/dev-env:main' || '' }}
needs: [ pre-commit ]
continue-on-error: ${{ matrix.experimental || false }}
strategy:
fail-fast: false
matrix:
toolchain: [ gcc, llvm, intel ]
mpi: ['', openmpi, mpich, intel]
include:
# flang is missing features in 16.0.6
- toolchain: llvm
experimental: true
steps:
- name: Install missing packages
run: dnf install -y bzip2 python-unversioned-command
- name: Load mpi module ${{ matrix.mpi }}
run: |
# Get interactive profile to be able to load modules
source /etc/profile

# Save the current environment since we only want the added difference
printenv > orig_env

# Load the relevant mpi module
module load mpi/${{ matrix.mpi }}
printenv > module_env

diff orig_env module_env | sed -n 's/> //p' >> $GITHUB_ENV

# Set MPI flag on
echo "WITH_MPI=ON" >> $GITHUB_ENV
if: ${{ matrix.mpi }}
- name: Enable msvc toolchain on windows
uses: ilammy/msvc-dev-cmd@v1
if: contains(matrix.os, 'windows')
- name: Activate Intel compilers
run: |
source /etc/profile
printenv > orig_env
module load compiler
printenv > module_env
diff orig_env module_env | sed -n 's/> //p' >> $GITHUB_ENV
echo $PATH >> $GITHUB_PATH
if: matrix.toolchain == 'intel'
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Run CMake configuration for ${{ matrix.toolchain }} toolchain
uses: lukka/[email protected]
with:
workflowPreset: "${{ matrix.toolchain }}-ci"

coverage:
name: Check test coverage
runs-on: ubuntu-latest
needs: [ tests ]
steps:
- uses: actions/checkout@v3
- uses: lukka/get-cmake@latest
- name: Get test coverage
uses: lukka/[email protected]
with:
workflowPreset: ci-coverage
- name: Get lcov data
uses: danielealbano/lcov-action@v3
with:
# Note lcov-action prepends and appends wild-cards *. Account for those
# https://github.com/danielealbano/lcov-action/issues/11
remove_patterns: /test/,/cmake-build*/
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
name: ${{ matrix.coverage }} coverage
files: coverage.info
flags: ${{ matrix.coverage }}
verbose: true
42 changes: 30 additions & 12 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,31 @@
wannier90.x
postw90.x
.DS_Store
make.inc
w90chk2chk.x
w90spn2spn.x
libwannier.a
libwan2.a
libwannier.so
libwannier.dylib
*~
*.x.dSYM
### Build system
cmake-build-*/
build/
CMakeLists.txt.user
CMakeCache.txt
CMakeFiles
CMakeScripts
Testing
Makefile
cmake_install.cmake
install_manifest.txt
compile_commands.json
CTestTestfile.cmake
_deps


### Other
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

### IDE files
.vscode
/.idea

### Project files
/CMakeUserPresets.json
Loading
Loading