|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions |
| 3 | + |
| 4 | +name: Continuous Integration |
| 5 | + |
| 6 | +on: |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - '**' # matches every branch |
| 10 | + pull_request: |
| 11 | + branches: |
| 12 | + - '**' # matches every branch |
| 13 | + |
| 14 | + |
| 15 | +permissions: |
| 16 | + contents: read # to fetch code |
| 17 | + actions: write # to cancel previous workflows |
| 18 | + |
| 19 | +# This is what will cancel the workflow |
| 20 | +concurrency: |
| 21 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 22 | + cancel-in-progress: true |
| 23 | + |
| 24 | + |
| 25 | +jobs: |
| 26 | + test_linux: |
| 27 | + runs-on: ubuntu-latest |
| 28 | + strategy: |
| 29 | + fail-fast: false |
| 30 | + matrix: |
| 31 | + python-version: [ "3.9", "3.10", "3.11", "3.12" ] |
| 32 | + |
| 33 | + steps: |
| 34 | + - name: Cancel Previous Runs |
| 35 | + |
| 36 | + with: |
| 37 | + access_token: ${{ github.token }} |
| 38 | + - uses: actions/checkout@v4 |
| 39 | + - name: Print concurrency group |
| 40 | + run: echo '${{ github.workflow }}-${{ github.ref }}' |
| 41 | + - name: Set up Python ${{ matrix.python-version }} |
| 42 | + uses: actions/setup-python@v5 |
| 43 | + with: |
| 44 | + python-version: ${{ matrix.python-version }} |
| 45 | + - name: Install dependencies |
| 46 | + run: | |
| 47 | + python -m pip cache purge |
| 48 | + python -m pip install --upgrade pip setuptools --no-cache-dir |
| 49 | + python -m pip install -r requirements-dev.txt --no-cache-dir |
| 50 | + pip install . --no-cache-dir |
| 51 | + - name: Test with pytest |
| 52 | + run: | |
| 53 | + pytest brainunit/ |
| 54 | +
|
| 55 | +
|
| 56 | + test_macos: |
| 57 | + runs-on: macos-latest |
| 58 | + strategy: |
| 59 | + fail-fast: false |
| 60 | + matrix: |
| 61 | + python-version: [ "3.9", "3.10", "3.11", "3.12" ] |
| 62 | + |
| 63 | + steps: |
| 64 | + - name: Cancel Previous Runs |
| 65 | + |
| 66 | + with: |
| 67 | + access_token: ${{ github.token }} |
| 68 | + - uses: actions/checkout@v4 |
| 69 | + - name: Print concurrency group |
| 70 | + run: echo '${{ github.workflow }}-${{ github.ref }}' |
| 71 | + - name: Set up Python ${{ matrix.python-version }} |
| 72 | + uses: actions/setup-python@v5 |
| 73 | + with: |
| 74 | + python-version: ${{ matrix.python-version }} |
| 75 | + - name: Install dependencies |
| 76 | + run: | |
| 77 | + python -m pip cache purge |
| 78 | + python -m pip install --upgrade pip setuptools --no-cache-dir |
| 79 | + python -m pip install -r requirements-dev.txt --no-cache-dir |
| 80 | + pip install . |
| 81 | + - name: Test with pytest |
| 82 | + run: | |
| 83 | + pytest brainunit/ |
| 84 | +
|
| 85 | +
|
| 86 | + test_windows: |
| 87 | + runs-on: windows-latest |
| 88 | + strategy: |
| 89 | + fail-fast: false |
| 90 | + matrix: |
| 91 | + python-version: [ "3.9", "3.10", "3.11", "3.12" ] |
| 92 | + |
| 93 | + steps: |
| 94 | + - name: Cancel Previous Runs |
| 95 | + |
| 96 | + with: |
| 97 | + access_token: ${{ github.token }} |
| 98 | + - uses: actions/checkout@v4 |
| 99 | + - name: Print concurrency group |
| 100 | + run: echo '${{ github.workflow }}-${{ github.ref }}' |
| 101 | + - name: Set up Python ${{ matrix.python-version }} |
| 102 | + uses: actions/setup-python@v5 |
| 103 | + with: |
| 104 | + python-version: ${{ matrix.python-version }} |
| 105 | + - name: Install dependencies |
| 106 | + run: | |
| 107 | + python -m pip cache purge |
| 108 | + python -m pip install --upgrade pip setuptools --no-cache-dir |
| 109 | + python -m pip install -r requirements-dev.txt --no-cache-dir |
| 110 | + pip install . --no-cache-dir |
| 111 | + - name: Test with pytest |
| 112 | + run: | |
| 113 | + pytest brainunit/ -p no:faulthandler |
0 commit comments