added variable name for runoff and allow level11 to be real #71
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: Continuous Integration | |
| on: | |
| push: | |
| branches: | |
| - "*" | |
| tags: | |
| - "*" | |
| pull_request: | |
| branches: | |
| - "main" | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| build_sdist: | |
| name: sdist | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: 3.11 | |
| - name: Build sdist | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install build | |
| python -m build --sdist --outdir dist-sdist . | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-sdist | |
| path: dist-sdist/*.tar.gz | |
| build_wheels: | |
| name: wheels for ${{ matrix.cfg.os }} / ${{ matrix.cfg.arch }} | |
| runs-on: ${{ matrix.cfg.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| cfg: | |
| - { os: ubuntu-24.04, arch: x86_64 } | |
| - { os: ubuntu-24.04-arm, arch: aarch64 } | |
| - { os: macos-13, arch: x86_64 } | |
| - { os: macos-14, arch: arm64 } | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - name: Build wheels | |
| uses: pypa/cibuildwheel@v3.1.4 | |
| env: | |
| CIBW_ARCHS: ${{ matrix.cfg.arch }} | |
| with: | |
| output-dir: dist-wheel-${{ matrix.cfg.os }}-${{ matrix.cfg.arch }} | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: dist-wheel-${{ matrix.cfg.os }}-${{ matrix.cfg.arch }} | |
| path: ./dist-wheel-${{ matrix.cfg.os }}-${{ matrix.cfg.arch }}/*.whl | |
| test_win_conda: | |
| name: win_conda | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: '0' | |
| - uses: mamba-org/setup-micromamba@v2 | |
| with: | |
| init-shell: cmd.exe | |
| environment-name: mhm-env | |
| create-args: >- | |
| python=3.12 | |
| numpy | |
| gfortran_win-64 | |
| netcdf-fortran | |
| pkg-config | |
| pytest-cov | |
| xarray | |
| netcdf4 | |
| - name: build wheel on win | |
| run: | | |
| pip install -v . | |
| mhm -h | |
| mhm -V | |
| mhm --pyversion | |
| mhm . | |
| pytest pybind/tests/ | |
| shell: cmd /C CALL {0} | |
| upload_to_pypi: | |
| needs: [build_wheels, build_sdist] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: dist-* | |
| merge-multiple: true | |
| path: dist | |
| - name: Publish to Test PyPI | |
| # only if working on main | |
| if: github.ref == 'refs/heads/main' | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.test_pypi_api_token }} | |
| repository_url: https://test.pypi.org/legacy/ | |
| skip_existing: true | |
| - name: Publish to PyPI | |
| # only if tagged | |
| if: startsWith(github.ref, 'refs/tags') | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| user: __token__ | |
| password: ${{ secrets.pypi_api_token }} |