Three new Fourier filters #128
Workflow file for this run
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: python | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test: | |
name: ${{ matrix.os }} py${{ matrix.case.python-version }} | |
runs-on: ${{ matrix.os }}-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu, macos, windows] | |
case: | |
- python-version: 3.11 | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.2.1 | |
with: | |
fetch-depth: 100 | |
persist-credentials: false | |
- name: Fetch git tags | |
run: git fetch origin 'refs/tags/*:refs/tags/*' | |
- name: Setup Python | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: ${{ matrix.case.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install numpy pytest pytest-flake8 | |
- name: Create, install, lint and test | |
run: | | |
cd packages | |
python create_python.py | |
pip install python/. | |
cd python | |
pytest --flake8 | |
deploy: | |
needs: test | |
name: Deploy to PyPI | |
runs-on: ubuntu-latest | |
# Only from the origin repository, not forks; only main and tags. | |
if: github.repository_owner == 'emsig' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/')) | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4.2.1 | |
with: | |
fetch-depth: 100 | |
persist-credentials: false | |
- name: Fetch git tags | |
run: git fetch origin 'refs/tags/*:refs/tags/*' | |
- name: Setup Python | |
uses: actions/setup-python@v5.2.0 | |
with: | |
python-version: ${{ matrix.case.python-version }} | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install wheel numpy | |
- name: Create package | |
run: | | |
cd packages | |
python create_python.py | |
echo "" | |
echo "Version:" | |
echo python python/setup.py --version | |
- name: Build source and wheel distributions | |
run: | | |
# Build source and wheel packages | |
cd packages/python | |
python setup.py sdist | |
python setup.py bdist_wheel | |
echo "" | |
echo "Generated files:" | |
ls -lh dist/ | |
- name: Publish to Test PyPI | |
if: success() | |
# [pin v1.4.2 (2021-02-08)] | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.TEST_PYPI_PASSWORD }} | |
packages_dir: packages/python/dist/ | |
repository_url: https://test.pypi.org/legacy/ | |
# Allow existing releases on test PyPI without errors. | |
# NOT TO BE USED in PyPI! | |
skip_existing: true | |
- name: Publish to PyPI | |
# Only for releases | |
if: success() && github.event_name == 'release' | |
# [pin v1.4.2 (2021-02-08)] | |
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29 | |
with: | |
user: __token__ | |
password: ${{ secrets.PYPI_PASSWORD }} | |
packages_dir: packages/python/dist/ |