name: CI
on: [push]

jobs:
  build:
    name: Tests
    # This job runs on Linux
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [2.7, 3.5, 3.6, 3.7]
    steps:
      - uses: actions/checkout@v1
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}
      - run: |
          pip install .[plot] pytest flake8
          cd tests && MATPLOTLIBRC="../ci" pytest ./

  publish:
    runs-on: ubuntu-latest
    if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
    name: Publish the package to PyPI
    steps:
      - run: python setup.py bdist_wheel --universal sdist
      - uses: pypa/gh-action-pypi-publish@master
        with:
          user: phylliadebot
          password: ${{ secrets.phylliadebot_pass }}
          repository_url: https://test.pypi.org/legacy/
name: CI
on: [push]

jobs:
  test:
    name: Tests
    # This job runs on Linux
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 4
      matrix:
        python-version: [2.7, 3.5, 3.6, 3.7]
    steps:
      - uses: actions/checkout@v1
      - name: Set up Python ${{ matrix.python-version }}
        uses: actions/setup-python@v1
        with:
          python-version: ${{ matrix.python-version }}
      - run: |
          pip install .[plot] pytest flake8
          cd tests && MATPLOTLIBRC="../ci" pytest ./

  publish:
    runs-on: ubuntu-latest
    needs: test
    if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
    name: Publish the package to PyPI
    steps:
      - run: python setup.py bdist_wheel --universal sdist
      - uses: pypa/gh-action-pypi-publish@master
        with:
          user: phylliadebot
          password: ${{ secrets.phylliadebot_pass }}
          repository_url: https://test.pypi.org/legacy/
Make build dependant on tests
Make build dependant on tests
