fix MCRALS (#760) #2110
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: Tests | |
on: | |
push: | |
branches: | |
- master | |
- develop | |
- feature/* | |
schedule: | |
- cron: '00 0 * * *' | |
pull_request: | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
test-package: | |
# prevent cron jobs from running on forks or release | |
if: | | |
(github.event_name == 'schedule' | |
&& github.repository == 'spectrochempy/spectrochempy' | |
&& !startsWith(github.ref, 'refs/release/')) || ( | |
github.event_name != 'schedule' | |
&& !startsWith(github.ref, 'refs/release/')) | |
name: Test using ${{ matrix.os }} and python ${{ matrix.pythonVersion }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash {0} | |
# do not use -l flag (do not work with macos when bash is se in login mode) | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-latest, ubuntu-latest, windows-latest] | |
pythonVersion: ["3.9", "3.12"] | |
exclude: | |
- os: macos-latest | |
pythonVersion: 3.9 | |
- os: windows-latest | |
pythonVersion: 3.9 | |
steps: | |
- name: Checkout spectrochempy repository | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set up Python ${{ matrix.pythonVersion }} | |
id: setup_python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.pythonVersion }} | |
cache: 'pip' | |
- name: Install dependencies for testing | |
run: | | |
python -m pip install -r requirements/requirements_test.txt | |
- name: Install spectrochempy | |
run: | | |
python -m pip install --no-deps . | |
python -m pip list | |
- name: Test with coverage | |
run: | | |
coverage run -m pytest tests --durations=10 | |
- name: Coverage report to xml | |
if: ${{ github.event_name == 'push' && matrix.pythonVersion == '3.12' && matrix.os == 'ubuntu-latest' }} | |
run: | | |
coverage xml | |
- name: Code Climate reporting | |
if: ${{ github.event_name == 'push' && matrix.pythonVersion == '3.12' && matrix.os == 'ubuntu-latest' }} | |
uses: paambaati/codeclimate-action@v5.0.0 | |
env: | |
CC_TEST_REPORTER_ID: ${{secrets.CC_TEST_REPORTER_ID}} |