|
| 1 | +name: build |
| 2 | + |
| 3 | +on: [push, pull_request] |
| 4 | + |
| 5 | +jobs: |
| 6 | + build: |
| 7 | + |
| 8 | + runs-on: ${{ matrix.os }} |
| 9 | + |
| 10 | + strategy: |
| 11 | + fail-fast: false |
| 12 | + matrix: |
| 13 | + python: ["2.7", "3.5", "3.6", "3.7", "3.8"] |
| 14 | + gtest_ver: ["1.8.0"] |
| 15 | + os: [ubuntu-latest] |
| 16 | + include: |
| 17 | + - python: "2.7" |
| 18 | + tox_env: "py27" |
| 19 | + - python: "3.5" |
| 20 | + tox_env: "py35" |
| 21 | + - python: "3.6" |
| 22 | + tox_env: "py36" |
| 23 | + - python: "3.7" |
| 24 | + tox_env: "py37" |
| 25 | + - python: "3.8" |
| 26 | + tox_env: "py38" |
| 27 | + |
| 28 | + steps: |
| 29 | + - uses: actions/checkout@v1 |
| 30 | + - name: Set up Python |
| 31 | + uses: actions/setup-python@v1 |
| 32 | + with: |
| 33 | + python-version: ${{ matrix.python }} |
| 34 | + - name: Install GoogleTest |
| 35 | + run: | |
| 36 | + wget https://github.com/google/googletest/archive/release-{{ matrix.gtest_ver }}.tar.gz |
| 37 | + tar -zxvf release-{{ matrix.gtest_ver }}.tar.gz |
| 38 | + cd googletest-release-{{ matrix.gtest_ver }}/googletest |
| 39 | + cmake . |
| 40 | + sudo make install |
| 41 | + - name: Install Boost.Test |
| 42 | + run: | |
| 43 | + sudo apt-get install libboost-test-dev valgrind |
| 44 | + - name: Install Python Deps |
| 45 | + run: | |
| 46 | + python -m pip install --upgrade pip |
| 47 | + pip install tox scons |
| 48 | + - name: Test |
| 49 | + run: | |
| 50 | + scons -j4 -C tests |
| 51 | + tox -e ${{ matrix.tox_env }} |
| 52 | +
|
| 53 | + linting: |
| 54 | + |
| 55 | + runs-on: ubuntu-latest |
| 56 | + |
| 57 | + steps: |
| 58 | + - uses: actions/checkout@v1 |
| 59 | + - name: Set up Python |
| 60 | + uses: actions/setup-python@v1 |
| 61 | + with: |
| 62 | + python-version: "3.7" |
| 63 | + - name: Install tox |
| 64 | + run: | |
| 65 | + python -m pip install --upgrade pip |
| 66 | + pip install tox |
| 67 | + - name: Linting |
| 68 | + run: | |
| 69 | + tox -e linting |
| 70 | +
|
| 71 | + deploy: |
| 72 | + |
| 73 | + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') |
| 74 | + |
| 75 | + runs-on: ubuntu-latest |
| 76 | + |
| 77 | + needs: [build, linting] |
| 78 | + |
| 79 | + steps: |
| 80 | + - uses: actions/checkout@v1 |
| 81 | + - name: Set up Python |
| 82 | + uses: actions/setup-python@v1 |
| 83 | + with: |
| 84 | + python-version: "3.7" |
| 85 | + - name: Install wheel |
| 86 | + run: | |
| 87 | + python -m pip install --upgrade pip |
| 88 | + pip install wheel |
| 89 | + - name: Build package |
| 90 | + run: | |
| 91 | + python setup.py sdist bdist_wheel |
| 92 | + - name: Publish package to PyPI |
| 93 | + uses: pypa/gh-action-pypi-publish@master |
| 94 | + with: |
| 95 | + user: __token__ |
| 96 | + password: ${{ secrets.pypi_token }} |
0 commit comments