|
| 1 | +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions |
| 2 | +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python |
| 3 | + |
| 4 | +name: pytest pcdl |
| 5 | +run-name: ${{ github.actor }} is pytesting the pcdl library on all supported python versions and operating systems. |
| 6 | + |
| 7 | +on: |
| 8 | + push: |
| 9 | + branches: ["master"] |
| 10 | + pull_request: |
| 11 | + branches: ["master"] |
| 12 | + |
| 13 | +jobs: |
| 14 | + build-linux: |
| 15 | + runs-on: ubuntu-latest |
| 16 | + strategy: |
| 17 | + fail-fast: false |
| 18 | + matrix: |
| 19 | + #python-version: ["3.11"] |
| 20 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 21 | + |
| 22 | + env: |
| 23 | + PYTHONPATH: /home/runner/work/physicelldataloader/physicelldataloader |
| 24 | + |
| 25 | + steps: |
| 26 | + - uses: actions/checkout@v3 |
| 27 | + - name: Set up Python ${{ matrix.python-version }} |
| 28 | + uses: actions/setup-python@v3 |
| 29 | + with: |
| 30 | + python-version: ${{ matrix.python-version }} |
| 31 | + - name: Install dependencies |
| 32 | + run: | |
| 33 | + sudo apt install ffmpeg imagemagick |
| 34 | + python -m pip install --upgrade pip |
| 35 | + python -m pip install flake8 pytest matplotlib numpy pandas scipy requests anndata |
| 36 | + #if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 37 | + - name: Lint with flake8 |
| 38 | + run: | |
| 39 | + # stop the build if there are Python syntax errors or undefined names |
| 40 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 41 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 42 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 43 | + - name: Test with pytest |
| 44 | + run: | |
| 45 | + pytest |
| 46 | +
|
| 47 | +
|
| 48 | + build-macosx: |
| 49 | + runs-on: macos-latest |
| 50 | + strategy: |
| 51 | + fail-fast: false |
| 52 | + matrix: |
| 53 | + #python-version: ["3.11"] |
| 54 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 55 | + |
| 56 | + env: |
| 57 | + PYTHONPATH: /Users/runner/work/physicelldataloader/physicelldataloader |
| 58 | + |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v3 |
| 61 | + - name: Set up Python ${{ matrix.python-version }} |
| 62 | + uses: actions/setup-python@v3 |
| 63 | + with: |
| 64 | + python-version: ${{ matrix.python-version }} |
| 65 | + - name: Install dependencies |
| 66 | + run: | |
| 67 | + brew install ffmpeg imagemagick |
| 68 | + python -m pip install --upgrade pip |
| 69 | + python -m pip install flake8 pytest matplotlib numpy pandas scipy requests anndata |
| 70 | + #if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 71 | + - name: Lint with flake8 |
| 72 | + run: | |
| 73 | + # stop the build if there are Python syntax errors or undefined names |
| 74 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 75 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 76 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 77 | + - name: Test with pytest |
| 78 | + run: | |
| 79 | + pytest |
| 80 | +
|
| 81 | +
|
| 82 | + build-windows: |
| 83 | + runs-on: windows-latest |
| 84 | + strategy: |
| 85 | + fail-fast: false |
| 86 | + matrix: |
| 87 | + #python-version: ["3.11"] |
| 88 | + python-version: ["3.8", "3.9", "3.10", "3.11"] |
| 89 | + |
| 90 | + env: |
| 91 | + PYTHONPATH: D:\a\physicelldataloader\physicelldataloader |
| 92 | + |
| 93 | + steps: |
| 94 | + - uses: actions/checkout@v3 |
| 95 | + - name: Set up Python ${{ matrix.python-version }} |
| 96 | + uses: actions/setup-python@v3 |
| 97 | + with: |
| 98 | + python-version: ${{ matrix.python-version }} |
| 99 | + - name: Install dependencies |
| 100 | + run: | |
| 101 | + choco install ffmpeg imagemagick |
| 102 | + python -m pip install --upgrade pip |
| 103 | + python -m pip install flake8 pytest matplotlib numpy pandas scipy requests anndata |
| 104 | + #echo 'set PYTHONPATH=D:\a\physicelldataloader\physicelldataloader' >> $GITHUB_ENV |
| 105 | + #if [ -f requirements.txt ]; then pip install -r requirements.txt; fi |
| 106 | + - name: Lint with flake8 |
| 107 | + run: | |
| 108 | + # stop the build if there are Python syntax errors or undefined names |
| 109 | + flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics |
| 110 | + # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide |
| 111 | + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics |
| 112 | + - name: Test with pytest |
| 113 | + run: | |
| 114 | + pytest |
| 115 | +
|
0 commit comments