Fixed ChimeraModel() fails due to missing positional argument 'sparse… #228
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
name: Python Test | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
concurrency: | |
group: WORKFLOW-PYTHON-TEST-${{ github.head_ref || github.run_id }} | |
cancel-in-progress: false | |
jobs: | |
Python: | |
if: ${{ !contains(github.head_ref, 'dependabot/github_actions')}} | |
runs-on: ${{ matrix.os }} | |
name: Python ${{ matrix.python-version }} Test on ${{ matrix.os }} | |
strategy: | |
max-parallel: 3 | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] | |
#os: [windows-latest] | |
#python-version: ['3.10'] | |
include: | |
- os: ubuntu-latest | |
path: ~/.cache/pip | |
- os: macos-latest | |
path: ~/Library/Caches/pip | |
- os: windows-latest | |
path: ~\AppData\Local\pip\Cache | |
concurrency: | |
group: PYTHON-TEST-${{ github.head_ref || github.run_id }}-${{ matrix.os }}-${{ matrix.python-version }} | |
cancel-in-progress: false | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version : ${{ matrix.python-version }} | |
- name: Get Python Version | |
shell: bash | |
run: | | |
set -eux | |
python --version > python_version.txt | |
cat python_version.txt | |
- name: Pip-Tools | |
shell: bash | |
run: | | |
python -m pip install pip-tools | |
pip-compile setup.cfg | |
pip-compile dev-requirements.in | |
- uses: actions/cache@v4 | |
if: always() | |
with: | |
path: ${{ matrix.path }} | |
key: ${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('dev-requirements.txt') }} | |
restore-keys: | | |
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('dev-requirements.txt') }} | |
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }}-${{ hashFiles('requirements.txt') }} | |
${{ runner.os }}-pip-${{ hashFiles('python_version.txt') }} | |
- name: Update | |
shell: bash | |
run: | | |
set -ux | |
python -m pip install --upgrade pip setuptools wheel build cmake | |
- name: Install Dependencies | |
shell: bash | |
run: | | |
set -eux | |
pip-sync requirements.txt dev-requirements.txt | |
- name: sccache | |
if: ${{ matrix.os == 'ubuntu-latest'}} | |
uses: hendrikmuhs/ccache-action@v1.2 | |
with: | |
verbose: 2 | |
variant: sccache | |
max-size: 1G | |
key: ${{ matrix.os }}-sccache-${{ hashFiles('python_version.txt') }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.RAND }} | |
restore-keys: | | |
${{ matrix.os }}-sccache-${{ hashFiles('python_version.txt') }}-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.RAND }} | |
${{ matrix.os }}-sccache-${{ hashFiles('python_version.txt') }}-${{ hashFiles('**/CMakeLists.txt') }} | |
${{ matrix.os }}-sccache-${{ hashFiles('python_version.txt') }} | |
- name: Install Eigen3 on linux | |
if: ${{ matrix.os == 'ubuntu-latest'}} | |
run: | | |
sudo apt-get install -y libeigen3-dev | |
sudo apt-get install -y libopenblas-dev | |
- name: Install Eigen3 on macos | |
if: ${{ matrix.os == 'macos-latest'}} | |
run: | | |
brew install eigen nlohmann-json | |
- name: Add msbuild to PATH | |
if: ${{ matrix.os == 'windows-latest'}} | |
uses: microsoft/setup-msbuild@v2.0.0 | |
- name: Prepare Cache | |
if: ${{ matrix.os == 'windows-latest'}} | |
shell: bash | |
run: | | |
set -eux | |
ls C:/vcpkg | |
MSBuild.exe -version > msbuild_version.txt | |
cat msbuild_version.txt | |
- name: Cache vcpkg | |
uses: actions/cache@v4 | |
if: ${{ matrix.os == 'windows-latest'}} | |
with: | |
path: | | |
C:/Users/runneradmin/AppData/Local/vcpkg/archives | |
key: ${{ matrix.os }}-vcpkg-${{ hashFiles('msbuild_version.txt') }} | |
restore-keys: | | |
${{ matrix.os }}-vcpkg-${{ hashFiles('msbuild_version.txt') }} | |
${{ matrix.os }}-vcpkg | |
- name: Install Eigen on windows | |
if: ${{ matrix.os == 'windows-latest'}} | |
shell: bash | |
run: | | |
vcpkg --triplet x64-windows-static install eigen3 | |
vcpkg --triplet x64-windows install eigen3 | |
vcpkg --triplet x64-windows-static install nlohmann-json | |
vcpkg --triplet x64-windows install nlohmann-json | |
vcpkg integrate install | |
- name: Show Help | |
shell: bash | |
run: | | |
set -eux | |
python setup.py --help-commands | |
pip install --help | |
- name: Build Debug Configure | |
if: ${{ github.event_name == 'workflow_dispatch' && matrix.os == 'ubuntu-latest' }} | |
shell: bash | |
run: | | |
set -eux | |
mkdir build | |
cmake -DCMAKE_BUILD_TYPE=Debug -DSKBUILD=TRUE -S . -B build | |
- name: Build Debug Build | |
if: ${{ github.event_name == 'workflow_dispatch' && matrix.os == 'ubuntu-latest' }} | |
shell: bash | |
run: | | |
set -eux | |
cmake --build build | |
- name: Build & Install | |
if: ${{ matrix.os == 'ubuntu-latest'}} | |
shell: bash | |
run: | | |
set -eux | |
export CMAKE_C_COMPILER_LAUNCHER=sccache | |
export CMAKE_CXX_COMPILER_LAUNCHER=sccache | |
export CMAKE_BUILD_TYPE=Debug | |
python setup.py --force-cmake install --build-type Debug --verbose | |
- name: Build & Install | |
if: ${{ matrix.os == 'macos-latest'}} | |
shell: bash | |
run: | | |
set -eux | |
export CIBUILDWHEEL=1 | |
export CMAKE_BUILD_TYPE=Debug | |
pip install -vvv . | |
- name: Build & Install | |
if: ${{ matrix.os == 'windows-latest'}} | |
shell: bash | |
run: | | |
set -eux | |
export CMAKE_BUILD_TYPE=Debug | |
export CMAKE_TOOLCHAIN_FILE="C:/vcpkg/scripts/buildsystems/vcpkg.cmake" | |
python setup.py --force-cmake install --build-type Debug --verbose | |
- name: Test | |
shell: bash | |
run: | | |
set -eux | |
python setup.py --build-type Debug test | |
- name: Generate | |
shell: bash | |
run: | | |
set -eux | |
python -m coverage xml | |
python -m coverage json | |
python -m coverage lcov | |
- uses: codecov/codecov-action@v4 | |
continue-on-error: true | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
env_vars: OS,PYTHON | |
name: "Openjij" | |
files: coverage.xml, coverage.json, coverage.lcov | |
flags: openjij | |
fail_ci_if_error: false | |
verbose: true | |
- name: Run codacy-coverage-reporter | |
uses: codacy/codacy-coverage-reporter-action@v1 | |
continue-on-error: true | |
if: ${{ matrix.os == 'ubuntu-latest'}} | |
with: | |
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }} | |
coverage-reports: coverage.xml | |
- name: Publish code coverage | |
uses: paambaati/codeclimate-action@v8.0.0 | |
continue-on-error: true | |
if: ${{ matrix.os == 'ubuntu-latest'}} | |
env: | |
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }} | |
- name: du | |
if: always() | |
shell: bash | |
run: | | |
du -a |