Integration Tests #4374
This file contains hidden or 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: Integration Tests | |
| on: | |
| push: | |
| pull_request: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: '42 5 * * *' | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| # We want to run on external PRs, but not on our own internal PRs as they'll be run | |
| # by the push to the branch. | |
| if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name != github.repository | |
| strategy: | |
| matrix: | |
| python-version: ['3.9', '3.10', '3.11', '3.12', '3.13'] | |
| 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 package and development dependencies | |
| run: | | |
| # we might still need a newer pip to be able to pull in lalsuite | |
| # we need setuptools>=69.3.0 to support PEP 625 and avoid PyPI deprecation warnings | |
| python -m pip install --upgrade pip setuptools | |
| pip install -e ${GITHUB_WORKSPACE}[test,wheel] | |
| - name: Run test suite with pytest | |
| run: | | |
| (cd .. && pytest --durations=0 $GITHUB_WORKSPACE/tests/ --log-file=$GITHUB_WORKSPACE/tests.log) | |
| - name: Build package | |
| run: | | |
| python setup.py sdist bdist_wheel | |
| check-wheel-contents dist/*.whl | |
| - name: upload artifacts | |
| if: matrix.python-version == 3.9 # only upload from one version (oldest, for max compatibility) | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| testpypi-publish: | |
| name: Upload release to TestPyPI | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| needs: build | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: testpypi | |
| url: https://test.pypi.org/p/PyFstat | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish package distributions to TestPyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| repository-url: https://test.pypi.org/legacy/ | |
| pypi-publish: | |
| name: Upload release to PyPI | |
| if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') | |
| needs: [build, testpypi-publish] | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: pypi | |
| url: https://pypi.org/p/PyFstat | |
| permissions: | |
| id-token: write # IMPORTANT: this permission is mandatory for trusted publishing | |
| steps: | |
| - name: Download dist artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: python-package-distributions | |
| path: dist/ | |
| - name: Publish package distributions to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 |