ENH: add suppport for Kokkos::complex Views #197
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions | |
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions | |
name: python-package | |
on: | |
push: | |
branches: [ main, develop ] | |
pull_request: | |
branches: [ main, develop ] | |
jobs: | |
linting: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: [3.7, 3.8, 3.9] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install flake8 | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# flake8 options are defined in setup.cfg | |
flake8 . --count --statistics | |
formatting: | |
runs-on: ubuntu-18.04 | |
strategy: | |
matrix: | |
python-version: [3.8] | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install black | |
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | |
DISTRIB_CODENAME=$(cat /etc/lsb-release | grep DISTRIB_CODENAME | awk -F '=' '{print $NF}') | |
sudo apt-get update | |
sudo apt-get install -y software-properties-common wget curl | |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add - | |
echo "deb http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-8 main" | sudo tee -a /etc/apt/sources.list.d/llvm-toolchain.list | |
echo "deb-src http://apt.llvm.org/${DISTRIB_CODENAME}/ llvm-toolchain-${DISTRIB_CODENAME}-8 main" | sudo tee -a /etc/apt/sources.list.d/llvm-toolchain.list | |
sudo apt-get update | |
sudo apt-get install -y clang-format-8 | |
- name: black format | |
run: | | |
black --diff --check . | |
- name: clang-format | |
run: | | |
set +e | |
FILES=$(find include src examples -type f | egrep '\.hpp$|\.cpp$|\.cpp\.in$') | |
FORMAT_OUT=$(clang-format-8 -output-replacements-xml ${FILES}) | |
RET=$(echo ${FORMAT_OUT} | grep -c '<replacement ') | |
if [ "${RET}" -ne 0 ]; then | |
echo -e "\nError! Code not formatted. Detected ${RET} lines\n" | |
clang-format-8 -i ${FILES} | |
git diff | |
exit ${RET} | |
fi |