Integrate Fortran sources and F2Py extension setup #33
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: Build Ubuntu 22.04 Package (Python 3.11 & 3.12) | |
| on: | |
| push: | |
| branches: [ main ] | |
| paths-ignore: | |
| - "build/**" | |
| - "dist/**" | |
| pull_request: | |
| branches: [ main ] | |
| jobs: | |
| build-ubuntu: | |
| runs-on: ubuntu-22.04 | |
| env: | |
| FFLAGS: "-O2 -fallow-argument-mismatch" | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # required for safe git pull | |
| - name: Sync with remote main | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git pull origin main --no-rebase | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y gfortran build-essential ninja-build | |
| gfortran --version | |
| # ------------------------- | |
| # Python 3.11 build | |
| # ------------------------- | |
| - name: Set up Python 3.11 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.11 | |
| - name: Build artifacts (Python 3.11) | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel numpy meson | |
| python setup.py build --build-base build/ubuntu-22.04-py3.11 | |
| python setup.py build_ext --inplace | |
| python setup.py sdist | |
| python setup.py bdist_wheel --dist-dir dist/ubuntu-22.04-py3.11 | |
| # ------------------------- | |
| # Python 3.12 build | |
| # ------------------------- | |
| - name: Set up Python 3.12 | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: 3.12 | |
| - name: Build artifacts (Python 3.12) | |
| run: | | |
| python -m pip install --upgrade pip setuptools wheel numpy meson | |
| python setup.py build --build-base build/ubuntu-22.04-py3.12 | |
| python setup.py build_ext --inplace | |
| python setup.py sdist | |
| python setup.py bdist_wheel --dist-dir dist/ubuntu-22.04-py3.12 | |
| # ------------------------- | |
| # Commit generated files | |
| # ------------------------- | |
| - name: Commit build and dist artifacts | |
| run: | | |
| git add build dist | |
| git status | |
| git commit -m "CI: add Ubuntu 22.04 builds for Python 3.11 & 3.12" || echo "Nothing to commit" | |
| git push origin main |