|
26 | 26 | c-compiler: 'clang'
|
27 | 27 | cxx-compiler: 'clang++'
|
28 | 28 | fail-fast: false
|
29 |
| - name: ${{ matrix.c-compiler}} Python ${{ matrix.py-version }} |
| 29 | + name: Linux ${{ matrix.c-compiler}} Python ${{ matrix.py-version }} |
30 | 30 |
|
31 | 31 |
|
32 | 32 | runs-on: ubuntu-latest
|
@@ -128,3 +128,97 @@ jobs:
|
128 | 128 | path: flake8-${{ matrix.c-compiler }}-${{ matrix.py-version }}.xml
|
129 | 129 | reporter: java-junit
|
130 | 130 | fail-on-error: false
|
| 131 | + |
| 132 | + mac: |
| 133 | + |
| 134 | + strategy: |
| 135 | + matrix: |
| 136 | + py-version: ['3.10'] |
| 137 | + fail-fast: false |
| 138 | + name: Mac clang Python ${{ matrix.py-version }} |
| 139 | + |
| 140 | + runs-on: macos-latest |
| 141 | + timeout-minutes: 180 |
| 142 | + env: |
| 143 | + MPIEXEC_FLAGS: "--allow-run-as-root --oversubscribe" |
| 144 | + PYNUCLEUS_BUILD_PARALLELISM: 3 |
| 145 | + SUITESPARSE_INCLUDE_DIR: /usr/local/Cellar/brewsci-suite-sparse/4.5.5_2/include |
| 146 | + SUITESPARSE_LIBRARY_DIR: /usr/local/Cellar/brewsci-suite-sparse/4.5.5_2/lib |
| 147 | + LDFLAGS: -L/usr/local/opt/brewsci-metis/lib -L/usr/local/opt/brewsci-parmetis/lib |
| 148 | + CPPFLAGS: -I/usr/local/opt/brewsci-metis/include -I/usr/local/opt/brewsci-parmetis/include |
| 149 | + |
| 150 | + steps: |
| 151 | + - name: Check out repo |
| 152 | + uses: actions/checkout@v3 |
| 153 | + |
| 154 | + - name: Pull ccache cache |
| 155 | + if: always() |
| 156 | + id: ccache-restore |
| 157 | + uses: actions/cache/restore@v3 |
| 158 | + with: |
| 159 | + path: /Users/runner/Library/Caches/ccache |
| 160 | + key: ccache-mac-${{ matrix.py-version }} |
| 161 | + |
| 162 | + - name: Setup GNU Fortran |
| 163 | + uses: modflowpy/install-gfortran-action@v1 |
| 164 | + |
| 165 | + - uses: actions/setup-python@v4 |
| 166 | + with: |
| 167 | + python-version: ${{ matrix.py-version }} |
| 168 | + |
| 169 | + - name: Install packages |
| 170 | + run: | |
| 171 | + brew install open-mpi ccache |
| 172 | + brew tap brewsci/num |
| 173 | + brew install brewsci-metis brewsci-parmetis brewsci-suite-sparse |
| 174 | +
|
| 175 | + - name: Get ccache config dir |
| 176 | + if: always() |
| 177 | + run: ccache --show-config |
| 178 | + |
| 179 | + - name: Install Python dependencies |
| 180 | + run: make prereq && make prereq-extra |
| 181 | + |
| 182 | + - name: Install |
| 183 | + run: PIP_INSTALL_FLAGS=-vvv make install |
| 184 | + |
| 185 | + - name: Remove ccache cache |
| 186 | + if: ${{ steps.ccache-restore.outputs.cache-hit }} |
| 187 | + shell: bash |
| 188 | + env: |
| 189 | + GH_TOKEN: ${{ github.token }} |
| 190 | + run: | |
| 191 | + gh extension install actions/gh-actions-cache |
| 192 | + gh actions-cache delete ccache-mac-${{ matrix.py-version }} --confirm |
| 193 | + continue-on-error: true |
| 194 | + |
| 195 | + - name: Push ccache cache |
| 196 | + if: always() |
| 197 | + uses: actions/cache/save@v3 |
| 198 | + with: |
| 199 | + path: /Users/runner/Library/Caches/ccache |
| 200 | + key: ccache-mac-${{ matrix.py-version }} |
| 201 | + |
| 202 | + - name: Ccache report |
| 203 | + if: always() |
| 204 | + run: ccache -s |
| 205 | + |
| 206 | + - name: Run tests |
| 207 | + if: always() |
| 208 | + run: python3 -m pytest --junit-xml=test-results-Mac-${{ matrix.py-version }}.xml tests/ |
| 209 | + |
| 210 | + - name: Archive test results |
| 211 | + uses: actions/upload-artifact@v3 |
| 212 | + if: always() |
| 213 | + with: |
| 214 | + name: Test results |
| 215 | + path: test-results-${{ matrix.py-version }}.xml |
| 216 | + |
| 217 | + - name: Report test results |
| 218 | + uses: dorny/test-reporter@v1 |
| 219 | + if: always() |
| 220 | + with: |
| 221 | + name: Test report (Mac, Python ${{ matrix.py-version }}) |
| 222 | + path: test-results-Mac-${{ matrix.py-version }}.xml |
| 223 | + reporter: java-junit |
| 224 | + fail-on-error: true |
0 commit comments