Fix 68 (#74) #54
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 | |
| on: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| branches: | |
| - main | |
| jobs: | |
| build: | |
| name: Build for (${{ matrix.python-version }}, ${{ matrix.os }}) | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: true | |
| matrix: | |
| os: ['ubuntu-latest', 'macos-latest', 'windows-latest'] | |
| python-version: ['3.9', '3.10', '3.11', '3.12'] | |
| gcc-version: ['12'] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Python info | |
| shell: bash -e {0} | |
| run: | | |
| which python | |
| python --version | |
| - name: Install Fortran compiler on Ubuntu | |
| if: matrix.os == 'ubuntu-latest' | |
| run: sudo apt-get update && sudo apt-get install -y gfortran | |
| - name: Install Fortran compiler on macOS | |
| if: matrix.os == 'macos-latest' | |
| run: | | |
| brew install gcc@${{ matrix.gcc-version }} | |
| echo "FC=gfortran-${{ matrix.gcc-version }}" >> "$GITHUB_ENV" | |
| echo "CC=gcc-${{ matrix.gcc-version }}" >> "$GITHUB_ENV" | |
| - name: Install Fortran compiler on Windows | |
| if: matrix.os == 'windows-latest' | |
| run: choco install mingw | |
| - name: Install dependencies | |
| if: steps.cache-virtualenv.outputs.cache-hit != 'true' | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[develop] | |
| - name: Upgrade pip and install dependencies on other OS | |
| if: matrix.os != 'macos-latest' | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -e .[develop] | |
| - name: Verify that we can build the package | |
| run: | | |
| python -m pip install build | |
| python -m build |