|
17 | 17 |
|
18 | 18 | jobs: |
19 | 19 | test-pypi-install: |
20 | | - name: Test PyPI install ${{ matrix.install-target }} (${{ matrix.python-version }}, ${{ matrix.os }}) |
| 20 | + name: Test PyPI install ${{ matrix.install-target }} ${{ matrix.pip-install-flags }} (${{ matrix.os }}, ${{ matrix.python-version }}, ${{ matrix.compiler }}-${{ matrix.compiler-version }}) |
| 21 | + runs-on: "${{ matrix.os }}" |
21 | 22 | strategy: |
22 | 23 | fail-fast: false |
23 | 24 | matrix: |
24 | | - os: ["ubuntu-latest", "macos-latest", "windows-latest"] |
| 25 | + os: [ "ubuntu-latest", "macos-latest", "windows-latest" ] |
25 | 26 | # Test against all security and bugfix versions: https://devguide.python.org/versions/ |
26 | 27 | python-version: [ "3.9", "3.10", "3.11", "3.12", "3.13" ] |
27 | 28 | # Check both 'library' install and the 'application' (i.e. locked) install |
28 | | - install-target: ["example-fgen-basic", "example-fgen-basic[locked]"] |
29 | | - runs-on: "${{ matrix.os }}" |
| 29 | + install-target: [ "example-fgen-basic", "example-fgen-basic[locked]" ] |
| 30 | + pip-install-flags: [ "--only-binary example-fgen-basic" ] |
| 31 | + toolchain: [ "no-toolchain" ] |
| 32 | + compiler: [ "no-compiler-needed" ] |
| 33 | + compiler-version: [ "na" ] |
| 34 | + include: |
| 35 | + # Source installs on all OS for a stable Python version |
| 36 | + # (no need to do more than the combinations below) |
| 37 | + # (duplicated the config as I can't see how to write this more succintly |
| 38 | + # using gitlab's matrix logic) |
| 39 | + - os: "ubuntu-latest" |
| 40 | + python-version: "3.11" |
| 41 | + install-target: "example-fgen-basic" |
| 42 | + pip-install-flags: "--no-binary example-fgen-basic" |
| 43 | + # TODO: consider adding other compilers |
| 44 | + # (see https://github.com/fortran-lang/setup-fortran) |
| 45 | + compiler: "gcc" |
| 46 | + compiler-version: "13" |
| 47 | + - os: "macos-latest" |
| 48 | + python-version: "3.11" |
| 49 | + install-target: "example-fgen-basic" |
| 50 | + pip-install-flags: "--no-binary example-fgen-basic" |
| 51 | + # TODO: consider adding other compilers |
| 52 | + # (see https://github.com/fortran-lang/setup-fortran) |
| 53 | + compiler: "gcc" |
| 54 | + compiler-version: "13" |
| 55 | + - os: "windows-latest" |
| 56 | + python-version: "3.11" |
| 57 | + install-target: "example-fgen-basic" |
| 58 | + pip-install-flags: "--no-binary example-fgen-basic" |
| 59 | + # TODO: consider adding other compilers |
| 60 | + # (see https://github.com/fortran-lang/setup-fortran) |
| 61 | + compiler: "gcc" |
| 62 | + compiler-version: "13" |
| 63 | + |
30 | 64 | steps: |
31 | 65 | - name: Set up Python "${{ matrix.python-version }}" |
32 | 66 | id: setup-python |
33 | 67 | uses: actions/setup-python@v4 |
34 | 68 | with: |
35 | 69 | python-version: "${{ matrix.python-version }}" |
| 70 | + - name: Install Fortran compiler |
| 71 | + # When building from source, ensure we have a Fortran compiler |
| 72 | + if: matrix.pip-install-flags == '--no-binary example-fgen-basic' |
| 73 | + uses: fortran-lang/setup-fortran@v1 |
| 74 | + id: setup-fortran |
| 75 | + with: |
| 76 | + compiler: ${{ matrix.compiler }} |
| 77 | + version: ${{ matrix.compiler-version }} |
36 | 78 | - name: Install |
37 | 79 | run: | |
38 | 80 | pip install --upgrade pip wheel |
39 | | - pip install "${{ matrix.install-target }}" 2>stderr.txt |
| 81 | + pip install "${{ matrix.install-target }}" ${{ matrix.pip-install-flags }} |
40 | 82 | - name: Check no warnings |
41 | 83 | if: matrix.os != 'windows-latest' |
42 | 84 | run: | |
| 85 | + # Install and save stderr to file so we can check for missing target errors |
| 86 | + # (re-install is a bit stupid, |
| 87 | + # but it doesn't actually do anything except emit the warning in practice) |
| 88 | + pip install "${{ matrix.install-target }}" 2>stderr.txt |
43 | 89 | if grep -q "WARN" stderr.txt; then echo "Warnings in pip install output" && cat stderr.txt && exit 1; else exit 0; fi |
44 | 90 | - name: Get version non-windows |
45 | 91 | if: matrix.os != 'windows-latest' |
|
0 commit comments