|
| 1 | +name: Build/Test CI |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build-and-test: |
| 7 | + # We want to run on external PRs, but not on our own internal PRs as they'll be run |
| 8 | + # by the push to the branch. Without this if check, checks are duplicated since |
| 9 | + # internal PRs match both the push and pull_request events. |
| 10 | + if: |
| 11 | + github.event_name == 'push' || github.event.pull_request.head.repo.full_name != |
| 12 | + github.repository |
| 13 | + |
| 14 | + runs-on: ${{ matrix.os }} |
| 15 | + |
| 16 | + defaults: |
| 17 | + run: |
| 18 | + shell: bash -l {0} |
| 19 | + |
| 20 | + strategy: |
| 21 | + fail-fast: false |
| 22 | + matrix: |
| 23 | + os: [ubuntu-latest, macos-latest] |
| 24 | + python-version: ["3.10", "3.11", "3.12"] |
| 25 | + language: ["c", "cxx", "python", "fortran"] |
| 26 | + |
| 27 | + steps: |
| 28 | + - uses: actions/checkout@v3 |
| 29 | + with: |
| 30 | + submodules: true |
| 31 | + |
| 32 | + - uses: conda-incubator/setup-miniconda@v2 |
| 33 | + with: |
| 34 | + auto-update-conda: true |
| 35 | + python-version: ${{ matrix.python-version }} |
| 36 | + mamba-version: "*" |
| 37 | + channels: conda-forge |
| 38 | + channel-priority: true |
| 39 | + |
| 40 | + - name: Install dependencies |
| 41 | + run: python -m pip install nox tomli |
| 42 | + |
| 43 | + - name: Install compilers |
| 44 | + run: mamba install c-compiler cxx-compiler fortran-compiler cmake |
| 45 | + |
| 46 | + - name: Run the language tests |
| 47 | + run: nox -s "test-langs-${{ matrix.python-version }}(lang='${{ matrix.language }}')" --python ${{ matrix.python-version }} --verbose |
| 48 | + |
| 49 | + - name: Coveralls |
| 50 | + if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.9' |
| 51 | + uses: AndreMiras/coveralls-python-action@v20201129 |
0 commit comments