Skip to content

models: Export SSUSI coefficent function #50

models: Export SSUSI coefficent function

models: Export SSUSI coefficent function #50

name: CI
on:
push:
branches:
- master
- github_ci
tags:
- '*'
jobs:
build_and_test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["2.7", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
include:
- name: py35
os: ubuntu-20.04
python-version: "3.5"
- name: py36
os: ubuntu-20.04
python-version: "3.6"
- name: macos
os: macos-latest
python-version: "3.x"
- name: windows
os: windows-latest
python-version: "3.x"
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
key: ${{ runner.os}}-pip-${{ matrix.python-version }}
path: ~/.cache/pip
restore-keys: |
${{ runner.os }}-pip-
- name: Update package list
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: MatteoH2O1999/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
cache-build: true
- run: lsb_release -a
if: startsWith(matrix.os, 'ubuntu')
- run: uname -a
if: startsWith(matrix.os, 'ubuntu')
- run: python --version
- name: Install dependencies
run: |
pip install -U pytest pytest-cov codecov coveralls
pip install scrutinizer-ocular
- name: Downgrade importlib for Py37
if: matrix.python-version == '3.7'
run: |
pip install "importlib-metadata<5"
- name: Install package
run: |
pip install -e ".[all]"
- run: pip list
- name: Test
run: |
python -m coverage run --parallel-mode --source=src -m pytest -v --doctest-glob='*.md'
- name: Combine and convert coverage
run: |
python -m coverage combine
python -m coverage report
python -m coverage xml -i
- name: Upload to Codecov
uses: codecov/codecov-action@v3
- name: Upload to Coveralls
if: startsWith(matrix.os, 'ubuntu') && matrix.python-version != '2.7'
run: |
python -m coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
COVERALLS_FLAG_NAME: py${{ matrix.python-version }}
coverage:
needs: build_and_test
runs-on: ubuntu-latest
steps:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Finish coverage collection
run: |
python -m pip install -U pip
python -m pip install -U coveralls
python -m coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
deploy:
name: Deploy to PyPi
needs: build_and_test
runs-on: ubuntu-latest
# Specifying a GitHub environment is optional, but strongly encouraged
environment: deploy
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
run: python -m pip install --upgrade pip
- run: python -m pip install build twine check-wheel-contents
- name: Build package
run: python -m build --sdist --wheel .
- run: ls -alF dist/
- run: check-wheel-contents dist/*.whl
- name: Check long_description
run: python -m twine check dist/*
- name: Publish package to TestPyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
skip-existing: true
- name: Publish tagged release to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true