fix error with the svd sst where the score calculation was not correct #24
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: test-pypi-push | |
# https://packaging.python.org/en/latest/tutorials/packaging-projects/ | |
# https://docs.pypi.org/trusted-publishers/using-a-publisher/ | |
on: | |
push: | |
paths: | |
- 'changepoynt/**' | |
- 'tests/**' | |
- '.github/workflows/test_pypi.yml' | |
- 'pyproject.toml' | |
pull_request: | |
jobs: | |
# test the package before we deploy it anywhere | |
test-package: | |
name: Run tests in local repository | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
python-version: [ '3.9', '3.11' ] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[test] | |
- name: Test with pytest | |
run: pytest | |
# publish the package to test.pypi.org | |
pypi-publish: | |
name: Upload release to PyPI | |
needs: test-package | |
runs-on: ubuntu-latest | |
# Specifying a GitHub environment is optional, but strongly encouraged | |
environment: release | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
# retrieve your distributions here | |
- name: Get the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Update the package Version for testing | |
# https://stackoverflow.com/questions/54310050/how-to-version-build-artifacts-using-github-actions | |
run: | | |
sh rename_version.sh ${{ github.run_number }} | |
- name: Make the build steps for the packaging | |
# https://stackoverflow.com/questions/21064581/how-to-overwrite-pypi-package-when-doing-upload-from-command-line | |
# https://peps.python.org/pep-0427/#file-name-convention | |
run: | | |
python3 -m pip install --upgrade build | |
python3 -m build | |
- name: Publish package distributions to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 | |
with: | |
repository-url: https://test.pypi.org/legacy/ | |
# download the package from the test repository and run the tests | |
pypi-download-test: | |
name: Install Package from PyPI | |
needs: pypi-publish | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ ubuntu-latest, windows-latest, macos-latest ] | |
python-version: [ '3.9', '3.11' ] | |
steps: | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
# https://github.com/actions/checkout#fetch-only-a-single-file | |
# get only the test files for the test of the installed package | |
- name: Get the test scripts from the original repository | |
uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
tests | |
- name: Install dependencies | |
# https://packaging.python.org/en/latest/guides/using-testpypi/ | |
run: | | |
python3 -m pip install pytest | |
python3 -m pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple/ changepoynt | |
- name: Test with pytest | |
run: pytest | |
# publish the package once all tests are run and the commit contains a keyword | |
pypi-publish-finished-version: | |
name: Upload release to PyPI | |
needs: pypi-download-test | |
runs-on: ubuntu-latest | |
if: contains(github.event.head_commit.message, '(publish attempt)') | |
# Specifying a GitHub environment is optional, but strongly encouraged | |
environment: release | |
permissions: | |
# IMPORTANT: this permission is mandatory for trusted publishing | |
id-token: write | |
steps: | |
# retrieve your distributions here | |
- name: Get the repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.11' | |
- name: Make the build steps for the packaging | |
# https://stackoverflow.com/questions/21064581/how-to-overwrite-pypi-package-when-doing-upload-from-command-line | |
# https://peps.python.org/pep-0427/#file-name-convention | |
run: | | |
python3 -m pip install --upgrade build | |
python3 -m build | |
- name: Publish package distributions to TestPyPI | |
uses: pypa/gh-action-pypi-publish@release/v1 |