Skip to content

Bump paambaati/codeclimate-action from 8.0.0 to 9.0.0 #1302

Bump paambaati/codeclimate-action from 8.0.0 to 9.0.0

Bump paambaati/codeclimate-action from 8.0.0 to 9.0.0 #1302

Workflow file for this run

name: Test
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- synchronize
jobs:
CPP:
strategy:
max-parallel: 3
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
#os: [windows-latest]
runs-on: ${{ matrix.os }}
if: ${{ github.actor != 'dependabot[bot]' || !contains(github.head_ref, 'dependabot')}}
#if: ${{github.event_name == 'workflow_dispatch'}}
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version : '3.10'
- name: Install Dep on linux
if: ${{ matrix.os == 'ubuntu-latest'}}
shell: bash
run: |
pip install ninja
sudo apt-get install -y libeigen3-dev
sudo apt-get install -y libopenblas-dev lcov
- name: Install Dep on macos
if: ${{ matrix.os == 'macos-latest'}}
shell: bash
run: |
pip install ninja
brew install eigen nlohmann-json lcov libomp
- 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
# C:/vcpkg/installed
- name: Install Dep on windows
if: ${{ matrix.os == 'windows-latest'}}
shell: powershell
run: |
vcpkg help triplet
vcpkg search eigen3
vcpkg search openblas
vcpkg search blas
vcpkg search clpack
vcpkg search lapack-reference
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
# vcpkg --triplet x64-windows-static install openblas
- name: Install CMake
run: |
pip install cmake
cmake --version
- name: sccache
uses: hendrikmuhs/ccache-action@v1.2
with:
verbose: 2
variant: sccache
max-size: 1G
key: ${{ matrix.os }}-cpp-sccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.RAND }}
restore-keys: |
${{ matrix.os }}-cpp-sccache-${{ hashFiles('**/CMakeLists.txt') }}-${{ env.RAND }}
${{ matrix.os }}-cpp-sccache-${{ hashFiles('**/CMakeLists.txt') }}
${{ matrix.os }}-cpp-sccache
- name: Prepare
shell: bash
run: mkdir build
- name: CMake Configure
if: ${{ matrix.os == 'ubuntu-latest'}}
shell: bash
run: >
cmake
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DENABLE_COVERAGE=On
-S .
-B build
- name: CMake Configure
if: ${{ matrix.os == 'macos-latest'}}
shell: bash
run: >
cmake
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-S .
-B build
- name: CMake Configure
if: ${{ matrix.os == 'windows-latest'}}
shell: powershell
run: >
cmake
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_C_COMPILER_LAUNCHER=sccache
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
-DCMAKE_TOOLCHAIN_FILE=C:/vcpkg/scripts/buildsystems/vcpkg.cmake
-S .
-B build
- name: CMake Build
shell: bash
run: >
cmake
--build build
--parallel
- name: CTest Help
shell: bash
working-directory: build
run: |
ctest --help
#- name: Run cimod_test
# if: ${{ matrix.os == 'windows-latest'}}
# shell: bash
# working-directory: build
# run: |
# ./tests/Debug/cimod_test.exe
- name: CMake Test
shell: bash
working-directory: build
run: >
ctest
--extra-verbose
--parallel
--schedule-random
- name: Run gcov
if: ${{ matrix.os == 'ubuntu-latest'}}
shell: bash
working-directory: build
run: >
gcov
tests/CMakeFiles/cimod_test.dir/test.cpp.gcda
-o tests/CMakeFiles/cimod_test.dir
-p
-l
-b
- name: du -a
shell: bash
if: always()
run: |
cd build
du -a
- uses: codecov/codecov-action@v4
if: ${{ matrix.os == 'ubuntu-latest'}}
continue-on-error: true
with:
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: build
name: cxxcimod
flags: cxxcimod
fail_ci_if_error: false
verbose: true
Python:
strategy:
max-parallel: 3
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
#os: [windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
#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
runs-on: ${{ matrix.os }}
#if: ${{github.event_name == 'workflow_dispatch'}}
if: ${{ !contains(github.head_ref, 'dependabot/github_actions')}}
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
python setup.py -h
pip-compile setup.cfg
pip-compile dev-requirements.in
- uses: actions/cache@v4
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 != 'windows-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 libomp
- 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 & 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 -G Ninja
- name: Build & Install
if: ${{ matrix.os == 'macos-latest'}}
shell: bash
run: |
set -eux
export CMAKE_C_COMPILER_LAUNCHER=sccache
export CMAKE_CXX_COMPILER_LAUNCHER=sccache
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
- 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: "Cimod"
files: coverage.xml, coverage.json, coverage.lcov
flags: cimod
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 != 'windows-latest'}}
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: coverage.xml
- name: Test & publish code coverage
uses: paambaati/codeclimate-action@v9.0.0
continue-on-error: true
if: ${{ matrix.os != 'windows-latest'}}
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
- name: du
if: always()
shell: bash
run: |
du -a