update url for tests.yml badge (#1472) #48
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: pypi | |
defaults: | |
run: | |
shell: bash | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
- cron: '0 13 * * 4' | |
release: | |
types: [published] | |
jobs: | |
package: | |
strategy: | |
matrix: | |
packages-dir: [ ".", "examples" ] | |
fail-fast: false | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/[email protected] | |
with: | |
submodules: recursive | |
fetch-depth: 0 # https://github.com/pypa/setuptools_scm/issues/480 | |
- uses: actions/[email protected] | |
with: | |
python-version: "3.12" | |
- run: pip install twine build | |
- run: | | |
unset CI | |
cd ${{ matrix.packages-dir }} | |
python -m build 2>&1 | tee build.log | |
exit `fgrep -i warning build.log | grep -v impl_numba/warnings.py \ | |
| grep -v "no previously-included files matching" \ | |
| grep -v "version of {dist_name} already set" \ | |
| grep -v -E "UserWarning: version of PySDM(-examples)? already set" \ | |
| wc -l` | |
twine check --strict dist/* | |
- uses: actions/upload-artifact@v4 | |
with: | |
path: ${{ matrix.packages-dir }}/dist | |
name: dist-${{ matrix.packages-dir }} | |
pkg_install_check: | |
strategy: | |
matrix: | |
platform: [ ubuntu-latest, macos-13, macos-14, windows-latest ] | |
python-version: [ "3.9", "3.12" ] | |
exclude: | |
- platform: macos-14 | |
python-version: "3.9" | |
runs-on: ${{ matrix.platform }} | |
needs: [ package ] | |
steps: | |
- uses: actions/[email protected] | |
with: | |
python-version: ${{ matrix.python-version }} | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist | |
- run: python -m pip install $PIP_INSTALL_ARGS dist/*.whl | |
- run: python -c "import PySDM; print(PySDM.__version__)" | |
- run: python -c "import PySDM_examples; print(PySDM_examples.__version__)" | |
publish: | |
runs-on: ubuntu-latest | |
needs: [ package, pkg_install_check ] | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
pattern: dist-* | |
merge-multiple: true | |
path: dist | |
- if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: pypa/gh-action-pypi-publish@release/v1.12 | |
with: | |
attestations: false | |
repository_url: https://test.pypi.org/legacy/ | |
packages-dir: dist | |
- if: startsWith(github.ref, 'refs/tags') | |
uses: pypa/gh-action-pypi-publish@release/v1.12 | |
with: | |
attestations: false | |
packages-dir: dist |