|
| 1 | +# In general, we try to run on: |
| 2 | +# - The oldest supported python |
| 3 | +# - The latest stable python that is the common default on most systems and conda |
| 4 | +# - (During transitions) The newly released bleeding edge python |
| 5 | + |
| 6 | +name: Run Test Suite |
| 7 | + |
| 8 | +on: |
| 9 | + push: |
| 10 | + branches: |
| 11 | + - main |
| 12 | + pull_request: |
| 13 | + branches: |
| 14 | + - main |
| 15 | + |
| 16 | +concurrency: |
| 17 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 18 | + cancel-in-progress: true |
| 19 | + |
| 20 | +jobs: |
| 21 | + test: |
| 22 | + name: Tests on ${{ matrix.arch }} with Conda Python-${{ matrix.python }} |
| 23 | + runs-on: ${{ matrix.os }} |
| 24 | + defaults: |
| 25 | + run: |
| 26 | + shell: bash -l {0} |
| 27 | + strategy: |
| 28 | + fail-fast: false |
| 29 | + matrix: |
| 30 | + include: |
| 31 | + - os: ubuntu-latest |
| 32 | + python: "3.9" |
| 33 | + arch: Linux-x86_64 |
| 34 | + ompdisable: 0 |
| 35 | + - os: ubuntu-latest |
| 36 | + python: "3.10" |
| 37 | + arch: Linux-x86_64 |
| 38 | + ompdisable: 0 |
| 39 | + - os: ubuntu-latest |
| 40 | + python: "3.12" |
| 41 | + arch: Linux-x86_64 |
| 42 | + ompdisable: 0 |
| 43 | + - os: macos-latest |
| 44 | + python: "3.10" |
| 45 | + arch: MacOSX-x86_64 |
| 46 | + ompdisable: 1 |
| 47 | + - os: macos-latest |
| 48 | + python: "3.12" |
| 49 | + arch: MacOSX-x86_64 |
| 50 | + ompdisable: 1 |
| 51 | + - os: macos-latest |
| 52 | + python: "3.10" |
| 53 | + arch: MacOSX-arm64 |
| 54 | + ompdisable: 1 |
| 55 | + - os: macos-latest |
| 56 | + python: "3.12" |
| 57 | + arch: MacOSX-arm64 |
| 58 | + ompdisable: 1 |
| 59 | + steps: |
| 60 | + - name: Checkout |
| 61 | + uses: actions/checkout@v4 |
| 62 | + |
| 63 | + - name: Setup Conda Base |
| 64 | + run: | |
| 65 | + sudo rm -rf /usr/share/miniconda \ |
| 66 | + && sudo rm -rf /usr/local/miniconda \ |
| 67 | + && curl -SL -o miniforge.sh https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-${{ matrix.arch }}.sh \ |
| 68 | + && bash miniforge.sh -b -f -p ~/conda \ |
| 69 | + && source ~/conda/etc/profile.d/conda.sh \ |
| 70 | + && conda activate base \ |
| 71 | + && conda update -n base --yes conda |
| 72 | +
|
| 73 | + - name: Check Conda Config |
| 74 | + run: | |
| 75 | + source ~/conda/etc/profile.d/conda.sh \ |
| 76 | + && conda activate base \ |
| 77 | + && conda info \ |
| 78 | + && conda list \ |
| 79 | + && conda config --show-sources \ |
| 80 | + && conda config --show |
| 81 | +
|
| 82 | + - name: Install Dependencies |
| 83 | + run: | |
| 84 | + source ~/conda/etc/profile.d/conda.sh \ |
| 85 | + && conda activate base \ |
| 86 | + && conda install --file packaging/conda_build_requirements.txt |
| 87 | +
|
| 88 | + - name: Install |
| 89 | + run: | |
| 90 | + source ~/conda/etc/profile.d/conda.sh \ |
| 91 | + && conda activate base \ |
| 92 | + && pip install . |
| 93 | +
|
| 94 | + - name: Run Serial Tests |
| 95 | + run: | |
| 96 | + source ~/conda/etc/profile.d/conda.sh \ |
| 97 | + && conda activate base \ |
| 98 | + && export OMP_NUM_THREADS=2 \ |
| 99 | + && python3 -c 'import flacarray.tests; flacarray.tests.run()' |
| 100 | +
|
| 101 | + - name: Run MPI Tests |
| 102 | + run: | |
| 103 | + source ~/conda/etc/profile.d/conda.sh \ |
| 104 | + && conda activate base \ |
| 105 | + && export OMP_NUM_THREADS=1 \ |
| 106 | + && mpirun -np 2 python -c 'import flacarray.tests; flacarray.tests.run()' |
0 commit comments