|
| 1 | +name: Continous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: |
| 6 | + - main |
| 7 | + - master |
| 8 | + release: |
| 9 | + types: |
| 10 | + - created |
| 11 | + |
| 12 | +jobs: |
| 13 | + linux-tests: |
| 14 | + strategy: |
| 15 | + fail-fast: true |
| 16 | + matrix: |
| 17 | + config: |
| 18 | + - python-version: 3.6 |
| 19 | + tox: 36 |
| 20 | + - python-version: 3.7 |
| 21 | + tox: 37 |
| 22 | + - python-version: 3.8 |
| 23 | + tox: 38 |
| 24 | + - python-version: 3.9 |
| 25 | + tox: 39 |
| 26 | + poetry-version: [ 1.1.4 ] |
| 27 | + os: [ ubuntu-18.04, ubuntu-20.04 ] |
| 28 | + runs-on: ${{ matrix.os }} |
| 29 | + services: |
| 30 | + ohsome-api: |
| 31 | + image: julianpsotta/ohsome-api:1.3.2 |
| 32 | + ports: |
| 33 | + - 8080:8080 |
| 34 | + steps: |
| 35 | + - uses: actions/checkout@v2 |
| 36 | + - name: Set up testing Python ${{ matrix.config.python-version }} |
| 37 | + uses: actions/setup-python@v2 |
| 38 | + with: |
| 39 | + python-version: ${{ matrix.config.python-version }} |
| 40 | + - name: Set up base Python 3.9 |
| 41 | + uses: actions/setup-python@v2 |
| 42 | + with: |
| 43 | + python-version: 3.9 |
| 44 | + - name: Python Poetry Action |
| 45 | + uses: abatilo/actions-poetry@v2.1.0 |
| 46 | + with: |
| 47 | + poetry-version: ${{ matrix.poetry-version }} |
| 48 | + - name: Install dependencies |
| 49 | + run: | |
| 50 | + sudo add-apt-repository -y ppa:ubuntugis/ppa && sudo apt-get update && sudo apt-get install -y build-essential gdal-bin libgdal-dev |
| 51 | + python -m pip install --upgrade pip tox |
| 52 | + - name: Run tox |
| 53 | + env: |
| 54 | + OHSOME_URL: ohsome-api |
| 55 | + OHSOME_PORT: 8080 |
| 56 | + TOX_TESTENV_PASSENV: OHSOME_URL, OHSOME_PORT |
| 57 | + run: tox -e py${{ matrix.config.tox }} |
| 58 | + - name: Upload coverage to Codecov |
| 59 | + uses: codecov/codecov-action@v1 |
| 60 | + with: |
| 61 | + token: ${{ secrets.CODECOV_TOKEN }} |
| 62 | + flags: unittests |
| 63 | + env_vars: OS,PYTHON |
| 64 | + name: codecov-umbrella |
| 65 | + fail_ci_if_error: true |
| 66 | + verbose: true |
| 67 | + build-and-publish: |
| 68 | + name: Build and publish Python distributions 📦 to PyPI and TestPyPI |
| 69 | + runs-on: ubuntu-20.04 |
| 70 | + needs: |
| 71 | + - linux-tests |
| 72 | + steps: |
| 73 | + - uses: actions/checkout@v2 |
| 74 | + - name: Set up base Python 3.9 |
| 75 | + uses: actions/setup-python@v2 |
| 76 | + with: |
| 77 | + python-version: 3.9 |
| 78 | + - name: Python Poetry Action |
| 79 | + uses: abatilo/actions-poetry@v2.1.0 |
| 80 | + with: |
| 81 | + poetry-version: 1.1.4 |
| 82 | + - name: Publish distribution 📦 with test.pypi.org |
| 83 | + if: startsWith(github.ref, 'refs/tags') |
| 84 | + run: | |
| 85 | + poetry config repositories.testpypi https://test.pypi.org/legacy/ |
| 86 | + poetry config pypi-token.testpypi ${{ secrets.TEST_PYPI_API_TOKEN }} |
| 87 | + poetry build |
| 88 | + poetry publish -r testpypi |
| 89 | + - name: Publish distribution 📦 to PyPI |
| 90 | + if: startsWith(github.ref, 'refs/tags') |
| 91 | + run: | |
| 92 | + poetry config pypi-token.pypi ${{ secrets.PYPI_API_TOKEN }} |
| 93 | + poetry build |
| 94 | + poetry publish |
0 commit comments