Skip to content

more sophisticated model colour algorithm (#285) #1306

more sophisticated model colour algorithm (#285)

more sophisticated model colour algorithm (#285) #1306

Workflow file for this run

# This workflow will for a variety of Python versions
# - install the code base
# - lint the code base
# - test the code base
# - upload the test coverage to codecov
#
# It will also
# - build the package
# - check the package
#
name: CI using pip
on: [push, pull_request]
jobs:
Code_Consistency:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
- name: Suggestion to fix issues
if: ${{ failure() }}
run: |
echo "::notice::In project root run 'python.exe -m ruff . --fix' and commit changes to fix issues."
exit 1
Code_Testing:
strategy:
max-parallel: 4
matrix:
python-version: ['3.11', '3.12']
os: [ubuntu-latest, macos-latest, windows-2022]
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install dependencies
run: pip install -e '.[dev]'
- name: Test with pytest and coverage
run: |
pip install pytest pytest-cov
pytest --cov=src/easyreflectometry tests --cov-branch --cov-report=xml:coverage-unit.xml
- name: Upload coverage reports to Codecov
# only on ubuntu to avoid multiple uploads
if: runner.os == 'Linux'
uses: codecov/codecov-action@v5
with:
name: unit-tests-job
flags: unittests
files: ./coverage-unit.xml
fail_ci_if_error: true
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
slug: EasyScience/EasyReflectometryLib
Package_Testing:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies and build
run: |
pip install -e '.[dev]'
python -m build
- name: Check Build
run: |
cd ./dist
pytest ../