Skip to content

CI/CD change faulty runs #6

CI/CD change faulty runs

CI/CD change faulty runs #6

Workflow file for this run

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'
pull_request:
jobs:
pypi-publish:
name: upload release to PyPI
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@v2
- name: Update the package Version for testing
# https://stackoverflow.com/questions/54310050/how-to-version-build-artifacts-using-github-actions
run: |
run 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/
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@v2
with:
python-version: ${{ matrix.python-version }}
- 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