From 83df6ee4d6caa0d4f7860fc87fb064a38ef57b53 Mon Sep 17 00:00:00 2001 From: Dean Moldovan Date: Sun, 20 Feb 2022 22:01:46 +0100 Subject: [PATCH] wip Github Actions --- .appveyor.yml | 49 ------------------------ .github/workflows/tests.yml | 35 +++++++++++++++++ .travis.yml | 76 ------------------------------------- CMakeLists.txt | 2 +- 4 files changed, 36 insertions(+), 126 deletions(-) delete mode 100644 .appveyor.yml create mode 100644 .github/workflows/tests.yml delete mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index 7f178aed..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,49 +0,0 @@ -version: '{build}' -os: Visual Studio 2019 -platform: -- x86 -- x64 -environment: - PYPI_USER: - secure: VNmO0xqOUrgWa0uT/HO/mg== - PYPI_PASS: - secure: gqNQRQIXkXmSul5JkOKj4owHUprr3Q4gJ6U6Mtlgm4M= - matrix: - - CONDA: 36 - - CONDA: 37 - - CONDA: 38 -matrix: - exclude: - - platform: x86 - CONDA: 38 -install: -- git submodule update -q --init --recursive -- ps: | - if ($env:PLATFORM -eq "x64") { - $env:CMAKE_ARCH = "x64" - $env:CONDA = "$env:CONDA-x64" - } else { - $env:CMAKE_ARCH = "Win32" - } - $env:AppVeyorLogger = "C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" - $env:PATH = "C:\Miniconda$env:CONDA\;C:\Miniconda$env:CONDA\Scripts\;$env:PATH" - conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda update -q conda - conda install -q numpy scipy matplotlib pytest - conda info -a -build_script: -- mkdir build && cd build && cmake -A "%CMAKE_ARCH%" -DPB_WERROR=ON -DPB_NATIVE_SIMD=OFF .. -- cmake --build . --config Release -- /m /v:m /logger:"%AppVeyorLogger%" -test_script: -- activate base -- cmake --build . --config Release --target tests -- /v:m -deploy_script: -- ps: | - if ($env:APPVEYOR_REPO_TAG -eq "true") { - conda install -q setuptools wheel twine - cd $env:APPVEYOR_BUILD_FOLDER - $env:PB_NATIVE_SIMD = "OFF" - python setup.py bdist_wheel - twine upload -u $env:PYPI_USER -p $env:PYPI_PASS --skip-existing dist\*.whl - } diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 00000000..a1ac7c0e --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,35 @@ +name: tests +on: push +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + python-version: ["3.7", "3.12"] + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: python -m pip install wheel scipy matplotlib==3.7.3 pytest cmake ninja + - name: Set up MSVC + if: runner.os == 'Windows' + uses: ilammy/msvc-dev-cmd@v1 + - name: ccache + uses: hendrikmuhs/ccache-action@v1 + - name: Build + run: | + cmake -G Ninja -B build -DPB_WERROR=ON -DPB_NATIVE_SIMD=OFF + cmake --build build + - name: Test + run: cmake --build build --target tests + - name: Test package + run: | + python -m pip install . + python -c "import pybinding as pb; exit(pb.tests())" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 144d4fe9..00000000 --- a/.travis.yml +++ /dev/null @@ -1,76 +0,0 @@ -language: cpp -dist: trusty -sudo: false -env: - global: # PYPI USER and PASS - - secure: GmqIQsQ0VZT8AtmvrGSeIfr8LH/F1XlWAXkwYT4Duq4OrlOObcrdOnCie8CQm6NxLnUfZpVZQugEDrN9vX7/WTxx+SrHt5i/LGH7ZxYN6ihFujO/xgKkRmoXpqaMqfVtwEygKPeFRWvfpYorGeh+Zpwv0Mgc0iTBo2oQUec1QDk1+uebZISTYN4RhFJ8idmjIcO/9JwiNzWBwsKPjfgKXQmFGyofBtKOy5C9UWTuvwKqWeroUD7MruvWJb109aHcuCSuZfIO6MR7soY4Mfe4JyNyLRF6rwFpVOJQPR7fA0AC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- include: - - os: linux - compiler: gcc-4.8 - env: PYTHON=3.6 - - os: linux - compiler: gcc-4.8 - env: PYTHON=3.7 - - os: linux - compiler: gcc-4.8 - env: PYTHON=3.8 - - os: osx - osx_image: xcode7.3 - env: PYTHON=3.6 - - os: osx - osx_image: xcode7.3 - env: PYTHON=3.7 - - os: osx - osx_image: xcode7.3 - env: PYTHON=3.8 - - os: linux - compiler: gcc-4.8 - env: PYTHON=3.7 SDIST DEBUG - install: - # call cmake first to download dependencies which will be included in the sdist - - (mkdir build && cd build && cmake -DPYTHON_EXECUTABLE=$(which python) ..) - - python setup.py sdist && cd dist - - PB_WERROR=ON PB_BUILD_TYPE=Debug pip install -v *.tar.gz - script: - - python -c "import pybinding as pb; exit(pb.tests())" - cache: false -cache: ccache -before_install: -- | - echo "general config" - if [ "$TRAVIS_OS_NAME" = "linux" ]; then - export CXX=g++-4.8 CC=gcc-4.8; - elif [ "$TRAVIS_OS_NAME" = "osx" ]; then - export CXX=clang++ CC=clang; - fi -- | - echo "install miniconda" - if [ "$TRAVIS_OS_NAME" = "linux" ]; then OS=Linux-x86_64; else OS=MacOSX-x86_64; fi - wget -q -O miniconda.sh https://repo.continuum.io/miniconda/Miniconda3-latest-$OS.sh - bash miniconda.sh -b -p $HOME/miniconda - rm miniconda.sh - export PATH="$HOME/miniconda/bin:$PATH" - conda config --set always_yes yes --set changeps1 no - conda config --add channels conda-forge - conda update -q conda - conda create -q -n test-env python=$PYTHON scipy matplotlib kwant pytest cmake ccache - source activate test-env - conda info -a -install: -- mkdir build && cd build && cmake - -DPB_WERROR=ON - -DPB_NATIVE_SIMD=OFF - -DPYTHON_EXECUTABLE=$(which python) - .. -- make -j2 -- ccache -s -script: -- make tests -deploy: - provider: script - script: $TRAVIS_BUILD_DIR/support/deploy.sh - skip_cleanup: true - on: - tags: true diff --git a/CMakeLists.txt b/CMakeLists.txt index e128bc35..f665e5a3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5) project(pybinding CXX) set(CMAKE_CXX_STANDARD 11)