|
| 1 | +name: Build Main |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + schedule: |
| 8 | + # <minute [0,59]> <hour [0,23]> <day of the month [1,31]> <month of the year [1,12]> <day of the week [0,6]> |
| 9 | + # https://pubs.opengroup.org/onlinepubs/9699919799/utilities/crontab.html#tag_20_25_07 |
| 10 | + # Run every Monday at 18:00:00 UTC (Monday at 10:00:00 PST) |
| 11 | + - cron: '0 18 * * 1' |
| 12 | + |
| 13 | +jobs: |
| 14 | + test: |
| 15 | + runs-on: ${{ matrix.os }} |
| 16 | + strategy: |
| 17 | + matrix: |
| 18 | + python-version: [3.7, 3.8, 3.9] |
| 19 | + os: [ubuntu-latest, windows-latest, macOS-latest] |
| 20 | + |
| 21 | + steps: |
| 22 | + - uses: actions/checkout@v1 |
| 23 | + - name: Set up Python ${{ matrix.python-version }} |
| 24 | + uses: actions/setup-python@v1 |
| 25 | + with: |
| 26 | + python-version: ${{ matrix.python-version }} |
| 27 | + - name: Install Dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + pip install .[test] |
| 31 | + - name: Test with pytest |
| 32 | + run: | |
| 33 | + pytest --cov-report xml --cov=pointcloudutils pointcloudutils/tests/ |
| 34 | + - name: Upload codecov |
| 35 | + uses: codecov/codecov-action@v1 |
| 36 | + |
| 37 | + lint: |
| 38 | + runs-on: ubuntu-latest |
| 39 | + |
| 40 | + steps: |
| 41 | + - uses: actions/checkout@v1 |
| 42 | + - name: Set up Python |
| 43 | + uses: actions/setup-python@v1 |
| 44 | + with: |
| 45 | + python-version: 3.9 |
| 46 | + - name: Install Dependencies |
| 47 | + run: | |
| 48 | + python -m pip install --upgrade pip |
| 49 | + pip install .[test] |
| 50 | + - name: Lint with flake8 |
| 51 | + run: | |
| 52 | + flake8 pointcloudutils --count --verbose --show-source --statistics |
| 53 | + - name: Check with black |
| 54 | + run: | |
| 55 | + black --check pointcloudutils |
| 56 | +
|
| 57 | + publish: |
| 58 | + if: "contains(github.event.head_commit.message, 'Bump version')" |
| 59 | + needs: [test, lint] |
| 60 | + runs-on: ubuntu-latest |
| 61 | + |
| 62 | + steps: |
| 63 | + - uses: actions/checkout@v1 |
| 64 | + - name: Set up Python |
| 65 | + uses: actions/setup-python@v1 |
| 66 | + with: |
| 67 | + python-version: 3.9 |
| 68 | + - name: Install Dependencies |
| 69 | + run: | |
| 70 | + python -m pip install --upgrade pip |
| 71 | + pip install setuptools wheel |
| 72 | + - name: Build Package |
| 73 | + run: | |
| 74 | + python setup.py sdist bdist_wheel |
| 75 | + - name: Publish to PyPI |
| 76 | + uses: pypa/gh-action-pypi-publish@master |
| 77 | + with: |
| 78 | + user: AllenCellModeling |
| 79 | + password: ${{ secrets.PYPI_TOKEN }} |
0 commit comments